public interface MessageReceiver
A service implement this method to receive messages that have been delivered to a channel for which the service is a consumer. The
messages are received asynchronously.
Use Of Collaboration Bus in an Enterprise Java Bean
When the Collaboration Bus is used in an Enterprise Java Bean (EJB), there are certain coding patterns that might be used where message
responses destined for the MessageReceiver will seem to be "stuck" and/or not arrive in a timely fashion. An example of this type of
coding pattern is the following:
A method on the EJB called "sendMyMessage" sends a message to a channel. The sendMyMessage method then waits for a response from the
channel to arrive at the MessageReceiver before returning control to the invoking software.
With this coding pattern the response message may not be delivered to the listener as long as control remains in the sendMyMessage
method. This condition is a result of the EJB framework attempting to enforce a transaction. Since the Collaboration Bus has been
designed not to participate in transactions, it is necessary to disable transaction processing in the EJB when a coding pattern is used
that leads to this condition. To disable transaction processing, the following annotation can be added at the class level to the
definition of the EJB:
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)