You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide support for a NULL_CHANNEL header or null-handler on endpoints [INT-1180] #5188
When using a Gateway, any downstream endpoint might simply end the flow without any reply Message. For example a POJO-invoking Service Activator might call a method whose return value is NULL. Normally that would cause a gateway to hang until it times out. Perhaps we can provide something like 'null-handler' on endpoints where a null return value is foreseeable. Or perhaps, we should add a NULL_CHANNEL header in addition to REPLY_CHANNEL and ERROR_CHANNEL. Considering we define a default "nullChannel" that acts like /dev/null, that seems like a fairly consistent solution with our approach to "errorChannel".
My current thinking on this issue is that we do not need to add support for a "nullChannel" message header. Instead, we can do three things:
add namespace support for the 'requires-reply' property on endpoints that may return NULL values (e.g. service-activator)
consider it an error (or at least have requiresReply=TRUE by default) for Transformers to return NULL (contract being that a Transformer must transform a source Message into a target Message)
add support for a MessageHeader "requiresReply" that can always be set to TRUE in the Gateway before it sends a request
Option #3 in particular would ensure that either a reply is returned or an Exception is thrown from the Gateway. The 'exceptionMapper' strategy on a Gateway enables translation of those Exceptions into a Message if that is the preferred approach.
NOTE: Filter elements already support the 'throw-exception-on-rejection' attribute, and Router elements support the 'resolution-required' attribute, so with the additions above it should be possible to create downstream flows for a Gateway that will always respond either with a reply Message or an Exception.
Instead of adding a null channel header, this issue has been addressed by alternative means. Most importantly, #5381 enables a <service-activator> to have a "requires-reply" value of TRUE (even though the default is still FALSE... allowing NULL returns). Also, Transformers now require a reply by default (see #5382), since the primary purpose there is to transform Message X into Message Y.
Activity
spring-operator commentedon Jun 23, 2010
Mark Fisher commented
might be worth considering this global channel (#4925) for handling replies, errors, and nulls
spring-operator commentedon Aug 18, 2010
Mark Fisher commented
My current thinking on this issue is that we do not need to add support for a "nullChannel" message header. Instead, we can do three things:
Option #3 in particular would ensure that either a reply is returned or an Exception is thrown from the Gateway. The 'exceptionMapper' strategy on a Gateway enables translation of those Exceptions into a Message if that is the preferred approach.
NOTE: Filter elements already support the 'throw-exception-on-rejection' attribute, and Router elements support the 'resolution-required' attribute, so with the additions above it should be possible to create downstream flows for a Gateway that will always respond either with a reply Message or an Exception.
spring-operator commentedon Aug 28, 2010
Mark Fisher commented
#5381 handles #1 above (adding "requires-reply" to <service-activator>).
The header value (#3 above) seems to cause more trouble than it's worth.
spring-operator commentedon Aug 28, 2010
Mark Fisher commented
Instead of adding a null channel header, this issue has been addressed by alternative means. Most importantly, #5381 enables a <service-activator> to have a "requires-reply" value of TRUE (even though the default is still FALSE... allowing NULL returns). Also, Transformers now require a reply by default (see #5382), since the primary purpose there is to transform Message X into Message Y.
spring-operator commentedon Aug 28, 2010
Mark Fisher commented
Changing from "invalid" to "won't fix". This issue has been addressed by other superseding issues as described in the previous comment.