If an operation selector of camel binding fails in selection of operation and the service has only one operation then the operation is executed. It should not be executed.
Created attachment 854016 [details]
1. run: mvn clean package -DskipTests jboss-as:deploy exec:java -Pudp jboss-as:undeploy
2. write: hello
3. you can see in the server log: "SWITCHYARD034505: No node has been matched with the Regex expression 'greet' in the payload. It couldn't determine the operation", but you can also notice in message trace that the message was accepted. It should not be, since the regex selector is set to 'greet'.
If a service contains more operations (methods) then the behaviour does not occur.
This is sort of an odd case, as operation selectors are only used when there is more than one operation in a service interface. The purpose of an operation selector is to help the runtime assign an operation. In the case where there's only a single operation, the runtime doesn't need help to assign an operation, so if the operation selector doesn't match the default operation resolution rules in the runtime are sufficient.
Long term, we should fail fast if the user decides to implement an operation selector and it doesn't match regardless of the number of operations. For FSW 6.0, the answer is that operation selectors are not required for services with a single operation.
Proposed doc text:
Operation selectors are used in combination with a service binding to help SwitchYard determine the target operation for a service invocation. When a service only has a single operation, an operation selector should not be used. If an operation selector is used for a service with a single operation, failure to assign an operation in the operation selector will not result in an error. If an operation selector fails to assign an operation for a service with multiple operations an error is reported.
Can this be closed as a documentation issue? Any change at this point would be a behavioral change in the runtime.
We could add validation to the tooling to generate a warning for cases where an operation is specified, when only one operation is defined on the service interface.
Hey Kevin, I propose rejecting this issue, or deferring to 7.0.
nacking this for 6.2 as per Rob's comments