Do not use forward slashes in SIBus Destination names with JMS

I have an SIBus destination called: ‘MY/QUEUE’.

I create a JMS QueueConnectionFactory and JMS Queue definition to this destination. jms/LoggingPoisonQueueCF and jms/LoggingPoisonQueue. When I attempt to put a message on the destination (using Spring JMS) I get the following exception:

org.springframework.jms.InvalidDestinationException:
CWSIA0046E: The parameter queue://MY/QUEUE?busName=SIBJMSBus 
is from a foreign implementation that is not supported.; 
nestedexception is javax.jms.InvalidDestinationException: CWSIA0046E:
The parameter queue://MY/QUEUE?busName=SIBJMSBus is from a foreign 
implementation that is not supported.; nested exception is
javax.jms.JMSException: CWSIA0385E: It is not permitted for a
destination URI to specify a queue manager, as found in URI :
queue://MY/QUEUE?busName=SIBJMSBus
at org.springframework.jms.support.JmsUtils.
convertJmsAccessException(JmsUtils.java:261)

Digging deeper into the stack trace, the offending piece of code is found:

Caused by: javax.jms.JMSException: CWSIA0385E:
It is not permitted for a destination URI to specify a
queue manager, as found in URI :

queue://My/Queue?busName=SCA.APPLICATION.widCell.Bus
at com.ibm.ws.sib.api.jms.impl.URIDestinationCreator.
processURI(URIDestinationCreator.java:476)
at com.ibm.ws.sib.api.jms.impl.URIDestinationCreator.
createDestinationFromString(URIDestinationCreator.java:285)
at com.ibm.ws.sib.api.jms.impl.JmsFactoryFactoryImpl.
createQueue(JmsFactoryFactoryImpl.java:523)
at com.ibm.ws.sib.api.jms.impl.JmsDestinationImpl.
checkNativeInstance(JmsDestinationImpl.java:707)

This URIDestinationCreator is interpreting the string as the format

queue://<queue manager>/<queue_name>?<busName>

I poked around in vain in the infocenter and I think I found the article that describes the issue. Basically what happens with a destination URI that is ambiguous like this one (Am I referring to a queue names ‘Queue’ on QueueManager ‘My’ , or am I referring to a queue called ‘My/Queue’) is that WebSphere will just toss an exception.

When I tried to see if slashes were used anywhere in WebSphere Process Server, I was surprised to find that they were in the SYSTEM bus. I also noticed that JMS isn’t used by much except the BPEL engine. When the BPEL engine uses it, they use ‘.’ to separate components. I assume it’s because they also ran into this exception.

The workaround is to just not use forward slashes. The secondary workaround is to create aliases for your SIBus destinations sans slash.

Author: dan

Comments

  1. In case someone stumbles across this post in the future, there’s a third way that might just work…
    You can escape the forward slash with a backward slash. i.e.

    MY\/QUEUE

  2. Thanks Dan and especial thanks for Yash. I’ve just encountered this problem but from different point. I really needed to specify MQ Manager and QUEUE not for local BUS, but for Foreign bus on Websphere MQ. And this approach by escaping intermediate slash Websphere App Server interprets as ordinal character and reads string as it contains the only name, but on MQ site resulted name parsed into to parts MQ Manager name and Queue name. Although it is a kind of kluge but it really works.

Leave a Reply

Your email address will not be published. Required fields are marked *