Author |
Message
|
mijalette |
Posted: Tue Jul 10, 2018 10:51 am Post subject: How to use an Admin subscripton in JMS |
|
|
Newbie
Joined: 10 Jul 2018 Posts: 1
|
Hi,
I have a developer who wants to use a administrated defined subscription in JMS but don’t 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 |
|
 |
tczielke |
Posted: Wed Jul 11, 2018 4:21 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
hughson |
Posted: Wed Jul 11, 2018 4:01 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
|
Back to top |
|
 |
tczielke |
Posted: Wed Jul 11, 2018 5:56 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
tczielke |
Posted: Wed Jul 11, 2018 5:57 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
hughson |
Posted: Wed Jul 11, 2018 9:35 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
tczielke |
Posted: Thu Jul 12, 2018 4:11 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
hughson |
Posted: Thu Jul 12, 2018 11:54 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
tczielke |
Posted: Fri Jul 13, 2018 4:31 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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." _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
|