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 / JMSPCFMessageAgent in bindings mode

Post new topicReply to topic
PCFMessageAgent in bindings mode View previous topic :: View next topic
Author Message
vasilev
PostPosted: Mon Jan 18, 2021 12:18 pm Post subject: PCFMessageAgent in bindings mode Reply with quote

Apprentice

Joined: 31 Oct 2014
Posts: 34
Location: Germany

Hello,
i am trying to make a java for Qstatus while using PCFMessageAgent in bindings mode.

I read that this parameter should be specified:

MQConnectionFactory.setMQConnectionOptions() - ConnectOption .

i am using:


Code:
MQQueueManager qmgr;
PCFMessageAgent agt;
 try {
  qmgr = new MQQueueManager("QM1");
  agt = new PCFMessageAgent(qmgr);
.
.
.


error that i get:

2495 0x000009bf MQRC_MODULE_NOT_FOUND


is it possible to configure somehow and use bindings or i have to use another connection way?

thank you !
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
tczielke
PostPosted: Mon Jan 18, 2021 1:01 pm Post subject: Reply with quote

Guardian

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

When you run an IBM MQ Java application in bindings mode, you need to make sure that your java library path is set to pick up some Unix shared object files (or DLLs for Windows) that are needed for JNI.

Example on Linux for a 64 bit java:
java -Djava.library.path=/opt/mqm/java/lib64 MYJavaApp

Is your application properly set to account for this requirement?
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
vasilev
PostPosted: Mon Jan 18, 2021 1:08 pm Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2014
Posts: 34
Location: Germany

thank you .
specified it and now i get another error - 2110.
tried another function in the code - only with pcf agent and seems to work.
the not working one is using:

var q = (String)responses[i].getParameterValue(MQConstants.MQCA_Q_NAME);
queue = qmgr.accessQueue (q, CMQC.MQOO_BROWSE | CMQC.MQOO_FAIL_IF_QUIESCING);
MQMessage message = new MQMessage ();
MQGetMessageOptions gmo = new MQGetMessageOptions ();
gmo.options = CMQC.MQGMO_BROWSE_FIRST | CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_CONVERT;


after i have added: CMQC.MQOO_INPUT_AS_Q_DEF
i have again new error

2042

not sure with this bindings how many things i need to change.
while using channel/ssl.. all is fine
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
hughson
PostPosted: Mon Jan 18, 2021 1:38 pm Post subject: Reply with quote

Padawan

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

vasilev wrote:
var q = (String)responses[i].getParameterValue(MQConstants.MQCA_Q_NAME);
queue = qmgr.accessQueue (q, CMQC.MQOO_BROWSE | CMQC.MQOO_FAIL_IF_QUIESCING);
MQMessage message = new MQMessage ();
MQGetMessageOptions gmo = new MQGetMessageOptions ();
gmo.options = CMQC.MQGMO_BROWSE_FIRST | CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_CONVERT;


after i have added: CMQC.MQOO_INPUT_AS_Q_DEF
i have again new error

2042


2042 is MQRC_OBJECT_IN_USE. If you don't intend to have more than one application reading from the queue at a time, then stop the other program. If you have cancelled it without closing the queue first, the queue manager may not yet be aware of its disappearance. You could toggle GET(DISABLED|ENABLED) to force it out.

If you do intend to have more than one application reading from the queue at a time, then ensure you have the queue set to SHARE and not NOSHARE, and also make sure your have DEFSOPT set to SHARED.

vasilev wrote:
not sure with this bindings how many things i need to change.
while using channel/ssl.. all is fine

It's possible that the differences you are seeing are due to cancelling applications hard and the queue manager not noticing that they are no longer there yet. Perhaps the channels are able to shutdown the connection to the queue manager better than a hard cancel of a locally bound application.

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
vasilev
PostPosted: Mon Jan 18, 2021 2:06 pm Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2014
Posts: 34
Location: Germany

hello,
thank you. yes.
till now I haven't seen them in client mode, but this is a development machine .. so they are not used so much.
I was just wondering if in the java code I can configure something to suppress these warnings.

not sure what happened, but now I don't get any errors and all is working fine.
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
hughson
PostPosted: Mon Jan 18, 2021 2:13 pm Post subject: Reply with quote

Padawan

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

vasilev wrote:
I was just wondering if in the java code I can configure something to suppress these warnings.

It's your code, you can choose to ignore the error codes that MQ gives you if you like. Not sure you'd get very far though!

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
fjb_saper
PostPosted: Tue Jan 19, 2021 5:49 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20448
Location: LI,NY

vasilev wrote:
thank you .
specified it and now i get another error - 2110.
tried another function in the code - only with pcf agent and seems to work.
the not working one is using:

var q = (String)responses[i].getParameterValue(MQConstants.MQCA_Q_NAME);
queue = qmgr.accessQueue (q, CMQC.MQOO_BROWSE | CMQC.MQOO_FAIL_IF_QUIESCING);
MQMessage message = new MQMessage ();
MQGetMessageOptions gmo = new MQGetMessageOptions ();
gmo.options = CMQC.MQGMO_BROWSE_FIRST | CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_CONVERT;


after i have added: CMQC.MQOO_INPUT_AS_Q_DEF
i have again new error

2042

not sure with this bindings how many things i need to change.
while using channel/ssl.. all is fine


This is expected for XMIT queues which have an open exclusive.
Do not walk through the messages, use the status enquiry and make sure the MONQ attribute is set to LOW or higher.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
vasilev
PostPosted: Tue Jan 19, 2021 7:43 am Post subject: Reply with quote

Apprentice

Joined: 31 Oct 2014
Posts: 34
Location: Germany

This is correct, the question is that on some environments and in some organisations - monitoring is not enabled and this does not depends on me ..
so i wanted to make some solution in the general case.
perhaps i can do one check more - if MSGAGE is empty - then go trough browse , if not - then take the MSGAGE parameter.

this is better i guess ?
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed Jan 20, 2021 8:46 pm Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20448
Location: LI,NY

vasilev wrote:
This is correct, the question is that on some environments and in some organisations - monitoring is not enabled and this does not depends on me ..
so i wanted to make some solution in the general case.
perhaps i can do one check more - if MSGAGE is empty - then go trough browse , if not - then take the MSGAGE parameter.

this is better i guess ?

It is still a crap chute because you can't walk through the messages on an XMITQ. It is either opened in EXCLUSIVE or get inhibited. So no Joy. It would be better to set the qmgr attribute MONQ on the qmgr or queue to LOW and redo the inquiry. Ask them why they do not allow monitoring as it gives you important information like last put date and time and last get date and time, as well as oldest message age... and with MONQ=LOW the overhead is negligeable. You really should be in an environment were milliseconds matter before you turn monitoring off.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSPCFMessageAgent in bindings mode
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.