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 IndexIBM MQ Java / JMSHow to use an Admin subscripton in JMS

Post new topicReply to topic
How to use an Admin subscripton in JMS View previous topic :: View next topic
Author Message
mijalette
PostPosted: Tue Jul 10, 2018 10:51 am Post subject: How to use an Admin subscripton in JMS Reply with quote

Newbie

Joined: 10 Jul 2018
Posts: 1

Hi,
I have a developer who wants to use a administrated defined subscription in JMS but dont know how to do it.
For example, I defined a subscription (by administration, not API) name SUB_TEST , unmanaged and durable.
The application specified the subscription name (session.createDurableSubscriber((Topic) destination, "SUB_TEST");
but when the application run, the subscription finally used is a dynamic subscription, with a name like this:
JMS:QM1:ClientID:SUB_TEST

I defined the subscription JMS:QM1:ClientID:SUB_TEST by administration, and it works OK.
But How can we used a subscription name like SUB_TEST only not the JMS:QM1:
Thanks.
Back to top
View user's profile Send private message
tczielke
PostPosted: Wed Jul 11, 2018 4:21 am Post subject: Reply with quote

Shaman

Joined: 08 Jul 2010
Posts: 738
Location: Illinois, USA

My JMS sample programs create subscriptions similar to what you stated. I may have missed it, but I don't see in the IBM MQ JMS documentation how you can change this behavior.
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
hughson
PostPosted: Wed Jul 11, 2018 4:01 pm Post subject: Reply with quote

Sentinel

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

It is possible to do what you wish. It was written up in an IBM Tech note here:

Using WebSphere MQ with Unmanaged Subscription

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
tczielke
PostPosted: Wed Jul 11, 2018 5:56 pm Post subject: Reply with quote

Shaman

Joined: 08 Jul 2010
Posts: 738
Location: Illinois, USA

I believe what mijalette was looking for was a way to control the name of the subscription name so that it can just be SUB_TEST and not have the other prefix information (e.g. JMS:QMGR:CLIENTID) on the subscription name. That "Using WebSphere MQ with Unmanaged Subscription" seems to reinforce that the subscription name does have to conform to these prefix rules:

Quote:
The full subscription name used by the WebSphere MQ classes for JMS is
constructed from a number of different pieces. The full name of the
subscription that is created in the queue manager will be of the form:
JMS:<QMName>:<clientID>:<subscriptionName><StreamName>

Where:
QMName is the name of the queue manager on which the subscription has
been created.

clientID is the client ID set on the ConnectionFactory in the JMS
application

subscriptionName is the subscription name provided as a parameter in the
createDurableSubscriber() call


I could not find any place in the IBM MQ JMS documentation where you can alter the subscription name to just be SUB_TEST, but again, maybe I missed it.
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
tczielke
PostPosted: Wed Jul 11, 2018 5:57 pm Post subject: Reply with quote

Shaman

Joined: 08 Jul 2010
Posts: 738
Location: Illinois, USA

I believe what mijalette was looking for was a way to control the name of the subscription name so that it can just be SUB_TEST and not have the other prefix information (e.g. JMS:QMGR:CLIENTID) on the subscription name. That "Using WebSphere MQ with Unmanaged Subscription" seems to reinforce that the subscription name does have to conform to these prefix rules:

Quote:
The full subscription name used by the WebSphere MQ classes for JMS is
constructed from a number of different pieces. The full name of the
subscription that is created in the queue manager will be of the form:
JMS:<QMName>:<clientID>:<subscriptionName><StreamName>

Where:
QMName is the name of the queue manager on which the subscription has
been created.

clientID is the client ID set on the ConnectionFactory in the JMS
application

subscriptionName is the subscription name provided as a parameter in the
createDurableSubscriber() call


I could not find any place in the IBM MQ JMS documentation where you can alter the subscription name to just be SUB_TEST, but again, maybe I missed it.
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
hughson
PostPosted: Wed Jul 11, 2018 9:35 pm Post subject: Reply with quote

Sentinel

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

tczielke wrote:
I believe what mijalette was looking for was a way to control the name of the subscription name so that it can just be SUB_TEST and not have the other prefix information (e.g. JMS:QMGR:CLIENTID) on the subscription name.

I was going by the requirement stated in the first sentence:
mijalette wrote:
I have a developer who wants to use a administrated defined subscription in JMS but don't know how to do it.

You're right, the link I provided does not describe how to do it they way they tried to do it, but does show the only way you can meet the initial requirement.

Hopefully it is helpful to mijalette in solving the developers problem.

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
tczielke
PostPosted: Thu Jul 12, 2018 4:11 am Post subject: Reply with quote

Shaman

Joined: 08 Jul 2010
Posts: 738
Location: Illinois, USA

I would have read that requirement differently. If a developer wanted to use an administrative subscription, I would agree on the subscription name with them (e.g. SUB_TEST1) and then define it with a DEFINE SUB. It seems like they were getting tripped up on how the IBM MQ JMS service provider appends some prefix information to the administrative subscription name that you define in MQ, and also need to provide in your JMS code.

The doc link you provided talks about unmanaged subscriptions (where you define the underlying queue that your subscription will use). Managed/unmanaged is a separate characteristic from administrative for subscriptions. Perhaps, I missed your point.
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jul 12, 2018 11:54 pm Post subject: Reply with quote

Sentinel

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

tczielke wrote:
The doc link you provided talks about unmanaged subscriptions (where you define the underlying queue that your subscription will use). Managed/unmanaged is a separate characteristic from administrative for subscriptions. Perhaps, I missed your point.
The doc is poorly titled I'm sure you'll agree, but it does explain what needs to be done to allow a JMS application to make use of a pre-defined subscription so hopefully it will be useful to the OP. If not they can ignore it.

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
tczielke
PostPosted: Fri Jul 13, 2018 4:31 am Post subject: Reply with quote

Shaman

Joined: 08 Jul 2010
Posts: 738
Location: Illinois, USA

Sorry, please disregard my last reply. For some reason, I missed this comment in your earlier reply:

"You're right, the link I provided does not describe how to do it they way they tried to do it, but does show the only way you can meet the initial requirement."
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSHow to use an Admin subscripton in JMS
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.