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 Index » IBM MQ API Support » Another Transaction Question

Post new topic  Reply to topic
 Another Transaction Question « View previous topic :: View next topic » 
Author Message
jmac
PostPosted: Mon Jul 09, 2001 11:04 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I have a need to update Queues belonging to 2 different Queue Managers. Is it possible to have the backout/commit under the control of 1 of these?

I have tried the following with No success:

QM1 = new MQQueueManager( QM1NAME, MQC.MQCNO_STANDARD_BINDING );
QM2 = new MQQueueManager( QM2NAME, MQC.MQCNO_STANDARD_BINDING );
Q1 = QM1.accessQueue(Q1NAME, openOptions, null, null, null);
Q2 = QM2.accessQueue(Q2NAME, openOptions, null, null, null);
QM2.begin();
MQMessage message1 = new MQMessage();
message1.userId = "ADMIN";
message1.writeString("BOGUS MESSAGE1");
MQPutMessageOptions pmo1 = new MQPutMessageOptions( );
pmo1.options = MQC.MQPMO_SET_IDENTITY_CONTEXT | MQC.MQPMO_SYNCPOINT ;
Q1.put(message1, pmo1);
System.out.println("A message has been successfully written to Queue '"
+ Q1.name );

MQMessage message2 = new MQMessage();
message2.userId = "ADMIN";
message2.writeString("BOGUS MESSAGE2");
MQPutMessageOptions pmo2 = new MQPutMessageOptions( );
pmo2.options = MQC.MQPMO_SET_IDENTITY_CONTEXT | MQC.MQPMO_SYNCPOINT ;
Q2.put(message2, pmo2);
System.out.println("A message was successfully written to Queue '" +
Q2.name + "'. Do you wish to commit BOTH messages? (Y/N)" );
ans = ReadString(1);
System.out.println("Your answer was '" + ans + "'");
if ( ! ans.toUpperCase().equals("Y") )
{
QM2.backout();
System.out.println("The messages have been backed out");
}
else
System.out.println("The messages remain in the Queue");

The message is removed from QM2 queue, but not the QM1 queue. What I really need is to be able to control all of these backouts from a single resource manager. It seems like this may not be possible.

Can anyone help me with this.

Thanks



_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kolban
PostPosted: Mon Jul 09, 2001 11:12 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

John,
In the story you have told, the operations measured are as expected. The scope of the transaction is associated with the handle to the queue manager. If you were using "regular" MQI API calls in a C or COBOL program, you would see the handle explicitly passed on different calls. Using Java, the MQQueueManager object internalizes the MQSeries queue manager connection handle.

To potentially achieve what you want, you could employ a transaction manager such as CICS. This could be configured with both queue managers and have it (the transaction manager) coordinate the outcome in both queue managers.

One other idea, although NOT tested would be to have one of the queue managers slaved to the other via an XA resource definition. MQSeries has the power to be both a transaction coordinator as well as a transaction resource manager. If one were configured as the coordinatior and the other defined as an XA resource manager in theory this should allow both to be scynhronized.

I have never heard of this being attempted before so your mileage may vary.

Why do you need to coordinate MQ activity over two queue managers?
Back to top
View user's profile Send private message
jmac
PostPosted: Mon Jul 09, 2001 11:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

I am working with MQSeries Workflow and have a need to post "CreateAndStartProcessInstance" messages to its EXEXMLINPUTQ. Within the same app, I am getting the information that I need to CreateAndStart the instance from a different QueueManager (i.e. not FMCQM used by MQWorkflow). I would like to coordinate these 2 queuemanagers.
At this point I am beginning to think that there may be a problem doing this. I have found the following statement in the MQSeries System Admin manual (Transaction support chapter):
--------
The following considerations apply to the use of MQSeries with all XA-compliant syncpoint coordinators:

Only one queue manager at a time may participate in a transaction coordinated by an instance of an external syncpoint coordinator: the syncpoint coordinator is effectively connected to the queue manager, and is therefore subject to the rule that only one connection at a time is supported.
--------

To me this seems to say that your idea of an external coordinator might not work.

Thanks for your time on this.



_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vknajtner
PostPosted: Mon Nov 26, 2001 11:46 am    Post subject: Reply with quote

Newbie

Joined: 25 Nov 2001
Posts: 5
Location: Brooklyn, NY

One possibility is to have the non-MQWorkflow QM (say, OTHER_QM) to join the FMCGRP (or whatever you call it) cluster. FMC.FMCGRP.FMCSYS.EXE.XML (or FMC.FMCGRP.EXE.XML) alias is visible on the cluster level, so you can feed it CreateProcess messages from OTHER_QM.

An alternative to joining FMCGRP cluster is to make a remote definition of EXEXMLINPUT queue (or one of aliasses) on OTHER_QM.

Regards,

Vlad

1. create a separate queue (say INPUT) on QM tha runs MQWorkflow
2. make a remote definition of INPUT on
Back to top
View user's profile Send private message Send e-mail
vknajtner
PostPosted: Mon Nov 26, 2001 11:52 am    Post subject: Reply with quote

Newbie

Joined: 25 Nov 2001
Posts: 5
Location: Brooklyn, NY

One possibility is to have the non-MQWorkflow QM (say, OTHER_QM) to join the FMCGRP (or whatever you call it) cluster. FMC.FMCGRP.FMCSYS.EXE.XML (or FMC.FMCGRP.EXE.XML) alias is visible on the cluster level, so you can feed it CreateProcess messages from OTHER_QM.

An alternative to joining FMCGRP cluster is to make a remote definition of EXEXMLINPUT queue (or one of aliasses) on OTHER_QM.

Regards,

Vlad

(please disregard junk on the bottom of my previous message)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Another Transaction Question
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.