Creating temporary conditions

I tried to create and use TemporaryQueue in JMS. My producer is successful, but my consumer is failing with the following error, for example. I realize this question may require full code, but it is very long and I am sure no one wants to sort it. However, if the answer is not that obvious from what I have provided here, feel free to point me to any resources that are related to TemporaryQueues or TempTopics, thanks. '

[Edit] I forgot to attach the code and the error:

The error causing the code:

QueueReceiver myRecv = mySession.createReceiver(myQueue);

      

Mistake:

CWSIA0086E: Failed to create a MessageConsumer for queue://_Q_CBF079A6A1E3018A0000000000262775?busName=myBus2
    at com.ibm.ws.sib.api.jms.impl.JmsMsgConsumerImpl.createCoreConsumer(JmsMsgConsumerImpl.java:689)
    at com.ibm.ws.sib.api.jms.impl.JmsMsgConsumerImpl.<init>(JmsMsgConsumerImpl.java:391)
    at com.ibm.ws.sib.api.jms.impl.JmsQueueReceiverImpl.<init>(JmsQueueReceiverImpl.java:58)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.instantiateConsumer(JmsQueueSessionImpl.java:203)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createConsumer(JmsSessionImpl.java:950)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createConsumer(JmsSessionImpl.java:900)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createReceiver(JmsQueueSessionImpl.java:123)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createReceiver(JmsQueueSessionImpl.java:100)

      

+2


source to share


2 answers


It seems that you are doing it in the wrong order. Typically, the consumer creates a temporary queue, opens it up for input, and then uses this object to populate the Reply-to fields in the request message. The service provider application listens in a predefined, well-known queue for the request message, and then uses the Reply-To fields from the request to respond to the reply. Thus, the producer application discovers a dynamic queue based on the received request.



Dynamic queues are usually not used as the destination for a request message or datagram. These use cases require a predefined, well-known queue that the consumer listens to. Dynamic queues are almost always for a response message in a request-response exchange.

+1


source


According to J2EE 1.4 docs :

The TemporaryQueue is a unique Queue created for the duration of the connection. This is a system queue that can only be used by the Connection it creates.



I suspect you are trying to use from a different connection.

0


source







All Articles