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 IBM MQ Support » Getting MessageID From Message

Post new topic  Reply to topic Goto page Previous  1, 2
 Getting MessageID From Message « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Fri Jan 11, 2019 5:37 am    Post subject: Re: Getting MessageID From Message Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Fri Jan 11, 2019 12:36 pm    Post subject: Re: Getting MessageID From Message Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
Robert_11
PostPosted: Mon Jan 21, 2019 3:38 am    Post subject: Re: Getting MessageID From Message Reply with quote

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
View user's profile Send private message
hughson
PostPosted: Mon Jan 21, 2019 7:33 pm    Post subject: Re: Getting MessageID From Message Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » General IBM MQ Support » Getting MessageID From Message
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.