is there any case where the message could be null in the Method onMessage(message), if my MessageConsumer is implementing the MessageListener (JBoss JMS 1.1 API)?
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
@MessageDriven( ... )
public class MyMessageConsumer implements MessageListener {
@Override
public void onMessage(final Message message) {
// is there any case, where message could be null here?
}
}
The interface alone does not prevent that. All examples assume that the message is not null. According to http://docs.oracle.com/javaee/6/tutorial/doc/bnbpo.html:
In my opinion that means, that message may not be null. Even an empty message must have a message ID and a date of sending.