|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Getting MessageID From Message |
« View previous topic :: View next topic » |
Author |
Message
|
Vitor |
Posted: Fri Jan 11, 2019 5:37 am Post subject: Re: Getting MessageID From Message |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Robert_11 wrote: |
can u suggest me how can i get Completion Code as 2,if wrong topic. |
Only if you promise to read what we suggest!
Specifically:
Vitor wrote: |
Because there's no such thing as a "wrong" topic name. A topic name is whatever you call it. |
Likewise:
hughson wrote: |
Use option MQPMO_WARN_IF_NO_SUBS_MATCHED and check for a completion code of MQCC_WARNING and a reason code of MQRC_NO_SUBS_MATCHED. |
Because no topic name is "wrong", the best you get is a warning that no-one is currently subscribed to the topic you've published on.
I also refer you to my "taking a step back" post because I don't think you can achieve what I suspect you're trying to achieve using the method you've selected. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jan 11, 2019 12:36 pm Post subject: Re: Getting MessageID From Message |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
From your original post:
Robert_11 wrote: |
Hai All,
Iam Trying to Post message into MQ Topic with C# code i.e.
public const String messageString = "TestMessage";
messageForPut = new MQMessage();
messageForPut.WriteString(messageString.Trim());
queueManager.Put(destType, null, queueManagerName, topicString, messageForPut, queuePutMessageOptions);
Iam sucessfully able to Publish the message using Topic . But what i want to do is log message id once the topic is published its data to its subscritptions
can any one suggest does i get MessagedID or Correlation id after i published one message using topic.
Thankk you. |
More precisely, you are publishing to a TOPIC STRING, and not a TOPIC OBJECT. _________________ 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 |
|
 |
Robert_11 |
Posted: Mon Jan 21, 2019 3:38 am Post subject: Re: Getting MessageID From Message |
|
|
Newbie
Joined: 07 Jan 2019 Posts: 6
|
Quote: |
As I said earlier, if you use MQPMO_WARN_IF_NO_SUBS_MATCHED then that would be a way to get a non-zero Completion Code if you used the wrong topic. It will give you an MQCC_WARNING (value 1) but that would be good enough I'm sure.
Have you tried this yet?
|
Yeh ur right but even when i had used 'wrong' topic name also iam getting zero completetion code iam not getting MQCC_WARNING(value 1)
Cheers,
Robert |
|
Back to top |
|
 |
hughson |
Posted: Mon Jan 21, 2019 7:33 pm Post subject: Re: Getting MessageID From Message |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Robert_11 wrote: |
hughson wrote: |
As I said earlier, if you use MQPMO_WARN_IF_NO_SUBS_MATCHED then that would be a way to get a non-zero Completion Code if you used the wrong topic. It will give you an MQCC_WARNING (value 1) but that would be good enough I'm sure.
Have you tried this yet?
|
Yeh Ur Correct and i had tried but even when i given 'wrong' topic name also i am getting zero Completion Code not MQCC_WARNING(value 1).
Thanks,
Robert |
Have you got subscribers using wildcarded topic strings on their subscriptions? If so, there will always be a subscription present.
Another way to force the application to use the correct topic string would be to mandate that they have to use a topic object. Then define the topic object with the correct topic string. If they put in the wrong topic object name they will get a 2085 error. Does that help?
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|