|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
not getting message from MQ(Mainframe) |
« View previous topic :: View next topic » |
Author |
Message
|
mathew_m |
Posted: Mon Dec 03, 2007 5:21 am Post subject: not getting message from MQ(Mainframe) |
|
|
Novice
Joined: 14 Oct 2007 Posts: 11
|
I am using the following java code to put/get message from Websphere from Z Os. It appears that message is being delivered to the que and it processed sucessfully. Ie I could see the message 'tRYINT TO GET THE REPLY BACK' in the log(apache). But after that(OutPutQueue.get(ReplyMessage,gmo)) it is not working. I am attaching the detials i got from CKQC(CICS) panel also. Please help me to know why mqget is not working here..
try {
/*************************************************************/
/* Create a hash table to hold the WebSphere MQ environment. */
/* Note: Change values to be appropriate. */
/*************************************************************/
java.util.Hashtable env = new java.util.Hashtable();
env.put(MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.SVRCONN");
env.put(MQC.HOST_NAME_PROPERTY, "172.20.64.228");
env.put(MQC.PORT_PROPERTY, new Integer(1415));
/********************************************************/
/* If a queue manager name was entered, then connect to */
/* it. Otherwise, use the default queue manager. */
/********************************************************/
qMgr = new MQQueueManager("MTQMGR", env);
/***********************************************************/
/* Open the queue, build the message, and put the message. */
/***********************************************************/
int openOptions1 = MQC.MQOO_OUTPUT;
MQQueue InputQueue = qMgr.accessQueue("MTQ1", openOptions1,
null, null, null);
MQMessage InputMessage = new MQMessage();
InputMessage.writeString(MQdata);
InputMessage.format = MQC.MQFMT_STRING;
/* InputMessage.characterSet = 500;*/
MQPutMessageOptions pmo = new MQPutMessageOptions();
InputQueue.put(InputMessage, pmo);
qMgr.commit();
/**********************************************************/
/* OPen the reply Q and get the message */
/**********************************************************/
int openOptions2 = MQC.MQOO_INPUT_AS_Q_DEF ;
MQQueue OutPutQueue = qMgr.accessQueue("QTEST2", openOptions2,
null, null, null);
MQMessage ReplyMessage = new MQMessage();
ReplyMessage.correlationId = InputMessage.messageId;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT;
gmo.waitInterval = MQC.MQWI_UNLIMITED;
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
System.out.println("tRYINT TO GET THE REPLY BACK");
OutPutQueue.get(ReplyMessage,gmo);
System.out.println("Gotcha the reply");
MQReplyData = ReplyMessage.readString(2028);
System.out.println("DISPLAYING THE MQReplyData");
System.out.println(MQReplyData);
System.out.println("END OF DISPLAYING THE MQReplyData");
/**********************************************************/
/* Close the queue and disconnect from the queue manager. */
/**********************************************************/
InputQueue.close();
OutPutQueue.close();
qMgr.disconnect();
detials from CKQC(cics)
***************************************************************************************
before running the program ***************************************************************************************
CKQCM2 Display Connection
panel
Read connection information. Then press F12 to cancel.
CICS Applid = CICS3 Connection Status = Connected QMgr name= CSQ1
Trace Num = 001 Tracing = Off API Exit = Off
Initiation Queue Name = CICS3.INITQ
--------------------------------- STATISTICS ---------------------------------
Number of in-flight tasks = 1 Total API calls = 131
Number of running CKTI = 1
APIs and flows analysis Syncpoint Recovery
---------------------------------------- ------------------- ---------------
Run OK 112 MQINQ 0 Tasks 32 Indoubt 0
Futile 0 MQSET 0 Backout 0 UnResol 0
MQOPEN 37 ------ Flows ------ Commit 21 Commit 0
MQCLOSE 36 Calls 166 S-Phase 21 Backout 0
MQGET 23 SyncComp 157 2-Phase 0
GETWAIT 8 SuspReqd 0 ------------- Task Use -------------
MQPUT 20 Msg Wait 7 Initial 8 Started 8 Busy 0
MQPUT1 0 Switched 165
F1=Help F12=Cancel Enter=Refresh
***************************************************************************************
After running the program
***************************************************************************************
CKQCM2 Display Connection panel
Read connection information. Then press F12 to cancel.
CICS Applid = CICS3 Connection Status = Connected QMgr name= CSQ1
Trace Num = 001 Tracing = Off API Exit = Off
Initiation Queue Name = CICS3.INITQ
--------------------------------- STATISTICS ---------------------------------
Number of in-flight tasks = 1 Total API calls = 136
Number of running CKTI = 1
APIs and flows analysis Syncpoint Recovery
---------------------------------------- ------------------- ---------------
Run OK 116 MQINQ 0 Tasks 33 Indoubt 0
Futile 0 MQSET 0 Backout 0 UnResol 0
MQOPEN 38 ------ Flows ------ Commit 22 Commit 0
MQCLOSE 38 Calls 174 S-Phase 22 Backout 0
MQGET 25 SyncComp 163 2-Phase 0
GETWAIT 9 SuspReqd 0 ------------- Task Use -------------
MQPUT 20 Msg Wait 8 Initial 8 Started 8 Busy 0
MQPUT1 0 Switched 173
F1=Help F12=Cancel Enter=Refresh
***************************************************************************************
List Local Queues - Status - CSQ1 Row 1 of 6
Type action codes, then press Enter. Press F11 to display all open queues.
1=Display applications 3=Alter 4=Manage
Queue name Disposition Depth
Output use Input use Uncommitted messages
<> M* PRIVATE CSQ1
MINDTREE.REPLY.Q1 QMGR CSQ1 0
0 2 N
MINDTREE.REQUEST.Q1 QMGR CSQ1 0
2 0 N
MINDTREE.REQUEST.Q2 QMGR CSQ1 0
MINDTREE.TRA.Q1 QMGR CSQ1 0
******** End of list ******** |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 03, 2007 6:05 am Post subject: Re: not getting message from MQ(Mainframe) |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mathew_m wrote: |
Please help me to know why mqget is not working here......
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
|
The replying application isn't setting the correl id?
It's also not clear (to me at least) if the display at the bottom is showing uncommitted messages. I think it's not, but if there are uncommitted messages your reply could be one of them. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Mon Dec 03, 2007 6:36 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Set the PMO and GMO to include NO_SYNCPOINT as the z/OS default is SYNCPOINT. |
|
Back to top |
|
 |
mathew_m |
Posted: Mon Dec 03, 2007 7:47 pm Post subject: |
|
|
Novice
Joined: 14 Oct 2007 Posts: 11
|
i want to have both the 'get' and 'put' in SYNCPOINT in Z/OS as there is some update happening in DB2 table.
Also the above code is working fine in a mainframe simulated environmnent(Mainframe express). I am not sure why the same code is not working in real mainframe. |
|
Back to top |
|
 |
zpat |
Posted: Mon Dec 03, 2007 11:58 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Don't rely on the default - always specify SYNCPOINT or NO_SYNCPOINT as the default varies between mainframe and non-mainframe (thank you IBM for that little gem of a design!).
Guess what - your code works on non-mainframe and does not work on mainframe - looks like a strong possibility to me. |
|
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
|
|
|
|