[JMS_SPEC-124] Sending a foreign message using a provider which does not support setJMSCorrelationIDAsBytes Created: 14/May/13  Updated: 14/May/13

Status: Open
Project: jms-spec
Component/s: None
Affects Version/s: 2.0
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Nigel Deakin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: jms21-forreview-minor

 Description   

It is optional whether a JMS provider supports the method setJMSCorrelationIDAsBytes on Message. This method is permitted to throw a java.lang.UnsupportedOperationException if the provider does not support this feature.

However there is an obscure case (which applies equally to JMS 1.1 and JMS 2.0) where the allowed behaviour is not specified. This is when a JMS provider is being used to send a message whose implementation is not its own (which JMS says must be allowed).

Imagine an application that receives a message from a JMS provider which supports native correlation ID values, and then sends the same message to a JMS provider which does not support them.

// receive message from JMS provider which supports native correlation ID values
MessageConsumer consumer = ....
Message message = consumer.receive(); 

// now call setJMSCorrelationIDAsBytes on the received message
// this will work as the provider supports native correlation ID values
message.setJMSCorrelationIDAsBytes(bytes);  

// now send this message using a JMS provider which does NOT support native correlation ID values
// should this throw a UnsupportedOperationException?
MessageProducer producer = ...
producer.send(message);  

There are two options here. Since the second JMS provider does not support native correlation ID values it must either throw a UnsupportedOperationException or simply ignore the value that was set.

The spec should be clarified to define the allowed behaviour.


Generated at Wed Jun 03 03:01:20 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.