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 » General Discussion » Message ID not retained between remote and local queues

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Message ID not retained between remote and local queues « View previous topic :: View next topic » 
Author Message
yashgt
PostPosted: Wed Sep 09, 2015 3:48 am    Post subject: Message ID not retained between remote and local queues Reply with quote

Apprentice

Joined: 11 Nov 2014
Posts: 38

Hi,

When I MQPUT a message to a remote queue, I obtain the Message ID and log it.

When I open the MQ Browser to look at messages on the local queue on a different queue manager, I see the message with a different Message ID.

Is there a way to ensure that the Message ID assigned at the Remote Queue is retained at the Local Queue?

I am using MQMI_NONE and MQPMO_NEW_MSG_ID option when doing the PUT operation.

I am using Websphere MQ 7.5.0.4.

Regards,
Yash
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 09, 2015 4:41 am    Post subject: Re: Message ID not retained between remote and local queues Reply with quote

Grand High Poobah

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

yashgt wrote:
When I MQPUT a message to a remote queue, I obtain the Message ID and log it.


How? A code snippit would be ideal.

yashgt wrote:
Is there a way to ensure that the Message ID assigned at the Remote Queue is retained at the Local Queue?


This is the default behavior. It's interesting that it's not working for you.

yashgt wrote:
I am using MQMI_NONE and MQPMO_NEW_MSG_ID option when doing the PUT operation.


Why MQMI_NONE on a PUT operation? What happens if you omit that option?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Sep 09, 2015 4:49 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
Location: US: west coast, almost. Otherwise, enroute.

New application?

When do you obtain and log? After the MQPUT?

How do you obtain and log?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 4:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Are you allowing MQ to create the MsgId? Or creating it yourself?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
yashgt
PostPosted: Wed Sep 09, 2015 4:55 am    Post subject: Reply with quote

Apprentice

Joined: 11 Nov 2014
Posts: 38

The documentation at http://www-01.ibm.com/support/knowledgecenter/SSB23S_1.1.0.7/com.ibm.ztpf-ztpfdf.doc_put.07/gtpc2/mqmdst.html?cp=SSB23S_1.1.0.7%2F0-3-7-1-7-1 says:
For the MQPUT and MQPUT1 calls, if MQMI_NONE or MQPMO_NEW_MSG_ID is specified by the application, the queue manager generates a unique message identifier when the message is put, and places it in the message descriptor sent with the message. The queue manager also returns this message identifier in the message descriptor belonging to the sending application. The application can use this value to record information about particular messages, and to respond to queries from other parts of the application.

For this reason we use these options. We want QM to generate the message ID.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Sep 09, 2015 5:00 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

yashgt wrote:
...if MQMI_NONE or MQPMO_NEW_MSG_ID is specified...

_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 09, 2015 5:00 am    Post subject: Reply with quote

Grand High Poobah

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

yashgt wrote:
The documentation at http://www-01.ibm.com/support/knowledgecenter/SSB23S_1.1.0.7/com.ibm.ztpf-ztpfdf.doc_put.07/gtpc2/mqmdst.html?cp=SSB23S_1.1.0.7%2F0-3-7-1-7-1 says:
For the MQPUT and MQPUT1 calls, if MQMI_NONE or MQPMO_NEW_MSG_ID is specified by the application, the queue manager generates a unique message identifier when the message is put, and places it in the message descriptor sent with the message.


Ok, let me be clearer. MQMI_NONE isn't an option - it's the constant for a blank message id. If it was a put option, it would start MQPMO. So confirm if you will that you're using MQPMO_NEW_MSG_ID as an option and assigning MQMI_NONE to the message id field.

And why when the documentation says to use one or the other, you elected to use both.

You also have not posted how you're harvesting the created id, as I and others have asked.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Okay, that's good. It means you aren't trying to stick string data into a byte field.

The other questions posed here still remain...
bruce2359 wrote:
New application?

When do you obtain and log? After the MQPUT?

How do you obtain and log?


that guy wrote:
How? A code snippit would be ideal.

_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 09, 2015 5:02 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
that guy wrote:
How? A code snippit would be ideal.


Ouch.

No drinks for you @ MQTC
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Sep 09, 2015 5:07 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Vitor wrote:
mqjeff wrote:
that guy wrote:
How? A code snippit would be ideal.


Ouch.

No drinks for you @ MQTC

A name that dare not speak its love?
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 5:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
mqjeff wrote:
that guy wrote:
How? A code snippit would be ideal.


Ouch.

No drinks for you @ MQTC



Of course I'll have a bottle with me...
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
yashgt
PostPosted: Wed Sep 09, 2015 8:27 am    Post subject: Reply with quote

Apprentice

Joined: 11 Nov 2014
Posts: 38

Agreed that we do not need both MQMI_NONE and MQPMO_NEW_MSG_ID

The Message ID is obtained only After the MQPUT.

Here is the code snippet:

Code:
  public static void sendByteMessage(final MQQueue destination, final byte payloadBytes[], final MessageHeader header)
            throws IOException, MQException {
        final MQMessage msg = new MQMessage();
       // msg.messageId = CMQC.MQPMO_NEW_MSG_ID;
        setMessagePriorityIfNecessary(header, msg);
        msg.format = XDR_FORMAT;
        msg.write(payloadBytes);
        final MQPutMessageOptions pmo = new MQPutMessageOptions();
        pmo.options += CMQC.MQPMO_SYNCPOINT;
        pmo.options += CMQC.MQPMO_NEW_MSG_ID;
        LOGGER.debug("Message Id before put :" + new String(msg.messageId));
        destination.put(msg, pmo);

        LOGGER.debug("Message Id after put :" + convertByteToHexString(msg.messageId));
        LOGGER.debug("Message Id after put Byte : " + msg.messageId);
        LOGGER.debug("Message Id after put Byte Arrays : " + Arrays.toString(msg.messageId));

        /*
         * MQHeaderIterator iterator = new MQHeaderIterator(msg); while (iterator.hasNext()) {
         * LOGGER.debug("Iterator has element"); MQHeader header1 = iterator.nextHeader(); LOGGER.debug("Header Type : "
         * + header1.type() + "::" + header1); } LOGGER.debug("Exiting-->");
         */
    }
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 09, 2015 8:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Well. You do log the msgid before the put, but that's likely to be completely meaningless if not actually empty.

Just to make sure - if you put a message to a QLOCAL, and then copy it using some kind of utility that doesn't change the MQMD to a QREMOTE- does it then show up with an alternate MsgID on the corresponding QLOCAL on the other qmgr?

Because that shouldn't happen.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 09, 2015 8:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

mqjeff wrote:
Well. You do log the msgid before the put, but that's likely to be completely meaningless if not actually empty.

Just to make sure - if you put a message to a QLOCAL, and then copy it using some kind of utility that doesn't change the MQMD to a QREMOTE- does it then show up with an alternate MsgID on the corresponding QLOCAL on the other qmgr?

Because that shouldn't happen.

Well... in order for that not to happen you still need PASS_ALL authorization, don't you?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Sep 09, 2015 8:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
mqjeff wrote:
Well. You do log the msgid before the put, but that's likely to be completely meaningless if not actually empty.

Just to make sure - if you put a message to a QLOCAL, and then copy it using some kind of utility that doesn't change the MQMD to a QREMOTE- does it then show up with an alternate MsgID on the corresponding QLOCAL on the other qmgr?

Because that shouldn't happen.

Well... in order for that not to happen you still need PASS_ALL authorization, don't you?


Huh?

Passing through a channel should never alter the msgid.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » General Discussion » Message ID not retained between remote and local queues
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.