|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQIACH_CHANNEL_TYPE |
« View previous topic :: View next topic » |
Author |
Message
|
Steve Coleman |
Posted: Fri Sep 15, 2017 6:54 am Post subject: MQIACH_CHANNEL_TYPE |
|
|
Newbie
Joined: 15 Sep 2017 Posts: 3
|
I'm attempting to get the channel type from my MQ virtual appliance. I have a java app and everything seems to be working fine except this.
String[] chTypeText = {"SENDER", "SERVER", "RECEIVER", "REQUESTER", "SVRCONN", "CLNTCONN", "CLUSRCVR", "CLUSSDIR"};
The channel type I'm inquiring about is definitely a SVRCONN channel because that's how it's listed in "display channel(*)". However the chTypeText keeps indexing to "CLUSSDIR" or int = 7 as the results.
Are my constants in chTypeText in the correct order? Am I missing any?
Thanks..any guidance is much appreciated. |
|
Back to top |
|
 |
exerk |
Posted: Fri Sep 15, 2017 7:38 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Should not "CLUSSDIR" read "CLUSSDR" ? _________________ 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 |
|
 |
Steve Coleman |
Posted: Fri Sep 15, 2017 8:37 am Post subject: |
|
|
Newbie
Joined: 15 Sep 2017 Posts: 3
|
Apologies...yes it should have been
String[] chTypeText = {"SENDER", "SERVER", "RECEIVER", "REQUESTER", "SVRCONN", "CLNTCONN", "CLUSRCVR", "CLUSSDR"};
That has been corrected. But the index being returned is "7" which would indicate that the channel type is a "CLUSSDR" but it's a SVRCONN channel.
So I'm asking if the constants are correct and in the appropriate position and / or am I missing any because the returned value is not correct with respect to the actual channel type.
Thanks xerk |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Sep 15, 2017 10:07 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
I think you are confused about the channel type value returned:
Code: |
- MQCHT_SENDER = 1
- MQCHT_SERVER = 2
- MQCHT_RECEIVER = 3
- MQCHT_REQUESTER = 4
- MQCHT_ALL" = 5
- MQCHT_CLNTCONN = 6
- MQCHT_SVRCONN = 7
- MQCHT_CLUSRCVR = 8
- MQCHT_CLUSSDR = 9
- MQCHT_MQTT = 10
- MQCHT_AMQP = 11 |
So, technically speaking, assuming zero-based, your string array should be:
Code: |
String[] chTypeText = {"", "SENDER", "SERVER", "RECEIVER", "REQUESTER", "ALL", "CLNTCONN", "SVRCONN", "CLUSRCVR", "CLUSSDR", "MQTT", "AMQP"}; |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
markt |
Posted: Fri Sep 15, 2017 10:36 am Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
To avoid the hardcoded text in your program, I'd use something like MQConstants.lookup(value, "MQCHT_.*"). |
|
Back to top |
|
 |
Steve Coleman |
Posted: Fri Sep 15, 2017 10:54 am Post subject: |
|
|
Newbie
Joined: 15 Sep 2017 Posts: 3
|
Thanks Roger. Appreciate the advice. I'm new to PCF and the example I found for those values was what I posted. Your update is spot on. A bit difficult to find to PCF examples. I like the examples on Capitalware. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Sep 17, 2017 5:08 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
In MQ v8 there is a new C/C++ header file cmqstrc.h that has functions for mapping integer values to constant strings. The MQCHT_STR function returns "MQCHT_SVRCONN" for value 7. _________________ Glenn |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|