ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Error while sending msg to tremporary queue, using MQJMS

Post new topic  Reply to topic
 Error while sending msg to tremporary queue, using MQJMS « View previous topic :: View next topic » 
Author Message
abhay09
PostPosted: Fri Sep 02, 2016 3:21 am    Post subject: Error while sending msg to tremporary queue, using MQJMS Reply with quote

Acolyte

Joined: 31 May 2016
Posts: 66

Guys,

I am following the suggested approach.


Scenario
using MQJMS APi to read/write message to MQ Queues

Receiving side:
1.) Enabled MQMD Read/Write enabled flag
2.) Reading messages from MQ queue using JMSConsumer
3.) Reading payload separately and all properties via propertyNames()

Sending side:
1.) Enabled MQMD Read/Write enabled flag
2.) Created new message, setting all properties read from receiving side
3.) Set TargetClient =1 , queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ); to remove RF2 headers
4.) sending.


On receiving side, i read ReplyToQ by WMQConstants.JMS_IBM_MQMD_REPLYTOQ property.

This reply to could be temporary queue or permanent queue.

Now, if temporary queue is set in ReplyToQ. then I am getting "dynamic queue name".

When tried to send message to above replyTOQ queue, I am getting exception as

Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2048' ('MQRC_PERSISTENT_NOT_ALLOWED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:202)


When debugged more understood that it is because of Delivery mode.

Need to set it as NON_PERSISTENT
context.createProducer().setDeliveryMode(DeliveryMode.NON_PERSISTENT)

After this it works fine,


But my question is:

- ReplytoQ could be any temporary or permanent
- How can I set DeliveryMode with only knowing queue name
- when creating queue MQQueue queue = (MQQueue) context.createQueue(qName);
- It is not giving me any type of queue .


Pls suggest how can i change the DeliveryMode flags at runtime? Which check should I add, to send message to both permanent and dynamic queues?

Basically, if we can get queue type , that can solve out problem, but could not find any method to get queue type in MQJMS.


Please help.

Any help would be appreciated.

Many Thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Sep 02, 2016 4:31 am    Post subject: Re: Error while sending msg to tremporary queue, using MQJMS Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

abhay09 wrote:
But my question is:

- ReplytoQ could be any temporary or permanent


Why would a reply be persistent irrespective of the queue type in use? By definition, a reply is the result of a repeatable question.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Sep 02, 2016 2:25 pm    Post subject: Re: Error while sending msg to tremporary queue, using MQJMS Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3251
Location: London, ON Canada

abhay09 wrote:
Need to set it as NON_PERSISTENT
context.createProducer().setDeliveryMode(DeliveryMode.NON_PERSISTENT)

Only do this if the message data is not important/critical because MQ is allowed to throw away non-persistent messages. See the MQ Knowledge Center for the rules on when this can happen.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
abhay09
PostPosted: Sat Sep 03, 2016 4:51 am    Post subject: Re: Error while sending msg to tremporary queue, using MQJMS Reply with quote

Acolyte

Joined: 31 May 2016
Posts: 66

RogerLacroix wrote:
abhay09 wrote:
Need to set it as NON_PERSISTENT
context.createProducer().setDeliveryMode(DeliveryMode.NON_PERSISTENT)

Only do this if the message data is not important/critical because MQ is allowed to throw away non-persistent messages. See the MQ Knowledge Center for the rules on when this can happen.

Regards,
Roger Lacroix
Capitalware Inc.



I don't want to do this from every ReplyToQ message.
Just want to do if for temporary dynamic queues in JMS case.
Now, not able to understand how can i find from queue object if it is temporary dynamic or not in MQJMS.

If I dont put this NON_PERSISTENT then, getting exception
"
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2048' ('MQRC_PERSISTENT_NOT_ALLOWED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:202)
"

Now, my code is generic code that should handle all REPLYTOQ.

Not sure, how to handle case of temporary dynamic queues?
Please suggest.
Back to top
View user's profile Send private message
hughson
PostPosted: Mon Sep 05, 2016 1:47 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

How about making the reply message the same persistence as the request message? Then any application using a temporary dynamic reply q should make its request as a non persistent message in order to get the reply back.

Then *your* application is not responsible for deciding whether a message should be persistent or non-persistent and any ramifications that result from getting that decision wrong.

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Error while sending msg to tremporary queue, using MQJMS
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.