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 » WebSphere Message Broker (ACE) Support » Getting output after combining different input XMLs

Post new topic  Reply to topic
 Getting output after combining different input XMLs « View previous topic :: View next topic » 
Author Message
amigupta1978
PostPosted: Mon Feb 11, 2002 8:24 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

Hi All,
I have a scenario where in I have to update the database from 3 different XML messages in the MQSI. Can I make all the three in one contact admin??
Say my database table as 3 fields A,B and C and there are 3 input messages coming one containaing the info about field A other abot B other about C. I can very well update the database using the information in the XML but what I want to do is to make these three messages in one transaction..so i.e if any of the message fails the database is rolled back completly?? Is there any way to achieve this???or any node avilable to do this??
Can I use aggregation node in MQSI v2.1 be used to solve this since it too wait for the messages from different queues, but I yhink it writes some information on the directory structure about the different messaged which Control node has sent??
or any other way to achieve the thing...

Thanks in Advance,
Regards,
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
mpuetz
PostPosted: Tue Feb 12, 2002 3:43 pm    Post subject: Reply with quote

Centurion

Joined: 05 Jul 2001
Posts: 149
Location: IBM/Central WebSphere Services

Hi,

you could do this be using message groups. The problem
is that you can only use groups coming from a single
source app and the app has to be written in such a
way as to generate the group info in the message headers.
Then you could set the commitscope in the input node
wait for groups to be complete. All messages will should
then be processed in the same XA commit scope.
(this is theory, I nevered really tried that

Other than that you could persist your messages A and B
in an additional database table until C arrives. When
C finally arrives you retrieve A and B and commit all
in the same flow. That's essentially the principle how
the aggregation node works. You can't use the aggragation
node out of the box, since its designed to work only in
conjunction with the fan-out node.




_________________
Mathias Puetz

IBM/Central WebSphere Services
WebSphere Business Integration Specialist
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Feb 12, 2002 5:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

And ...
You can use "Grouped message" concept only in MQMD Version 2. This version is supported only in AIX, HP-UX, OS/2, AS/400, Sun Solaris, Windows NT, plus MQSeries clients connected to these systems.

Regards,
Kiran
Back to top
View user's profile Send private message Visit poster's website
amigupta1978
PostPosted: Tue Feb 12, 2002 5:50 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

Hi,
Thnx for all the replies.
Actually I have tried using the Message Grouping flags. I set the different message to be a part of one group and then I put them on the MQSI input queue. MQInput node have the option of "All Message Avilable" (i.e it will start processing the messages after all the message in the message group avilable in the input Queue) and also checked the "Commit By Message Group" checkbox in the MQInput Node,and also the Logical Order Flag.
Now what I can understand from the IBM documentation is that MQSI will commit the message after the last input message from that Group is received. But actually what I am getting as the output is that MQSI process the first input message (with logical sequence number 1) and the remaining messages which are the part of the same group are left on the input queue only??
in simple terms say I have put 2 messages in the input queue with same group id and set the logical sequence number to 1 and 2 respectively (and of cousre the 2nd message which I put has the last message in Group flag set). The behaviour which I am getting is that when I put the first message to the input Queue (logical sequence no 1) it remains on the input queue..that is fine....
and when I put the second message in the group MQSI process the first message (thats OK) but it doesnot process the second message and this message remains in the input queue..
I dont know whether I am doing some mistake or is that the behaviour expected??
Has anybody used this feature in MQSI???
Thanks in advance
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kirani
PostPosted: Tue Feb 12, 2002 6:09 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Have you verified the GroupId, MsgFlags and MessageSeqNumber fields in MQMD header? Make sure your application is putting messages in groups. Do you have "Logical Order" checked in MQInput? If not, try selecting this option in the node.

Regards,
Kiran
Back to top
View user's profile Send private message Visit poster's website
amigupta1978
PostPosted: Tue Feb 12, 2002 6:21 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

Ya I have checked all the things like Group Id and message sequence number and all the things. They all are correct and I have checked the logical order flag too in the input node...

Regards,
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Miriam Kaestner
PostPosted: Wed Feb 13, 2002 3:31 am    Post subject: Reply with quote

Centurion

Joined: 26 Jun 2001
Posts: 103
Location: IBM IT Education Services, Germany

An MQInput node will alway get just one single message, though you can instruct it to wait until all messages belonging to that group are available on the input queue.
So, what you could use to fan in multiple messages in one message flow is
- either the Aggregate nodes from WMQI 2.1 (but this would mean you have to do the fan-out also in a message flow and just collect the replies),
- or use a plugin node like the MQGet node (available as SupportPac) or some other input node plugin
- or write your own temporary storage mechanism (in a database or a queue).
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Wed Feb 13, 2002 9:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Amit,

Could you post your program here that you are using to put Grouped messages on the queue? I have implemented this kind of logic before and it worked fine.

Kiran
Back to top
View user's profile Send private message Visit poster's website
amigupta1978
PostPosted: Wed Feb 13, 2002 10:01 am    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

Hi ,

Hi Miriam -- The problem is that it is ok that MQInput node get one message at the time but the thing is that it should pick up all the messages in the group I mean one by one it shud pick up all messages in the group, But the thing is MQSI is only picking up the first message while others remain in the Queue.

Hi Kiran

The program which I used is as below.

public class WriteQGroup
{
public static void main(String[] args) throws Exception
{
MQQueueManager _queueManager = null;
String qManager = "QMGR";
if (args.length<5)
{
System.out.println("usage WriteQGroup queuename filename Group msgseqno last");
return;
}

String str=args[1];
FileInputStream fis = null;
File ff=new File(str);
int lenfile=(int)ff.length();
fis = new FileInputStream(ff);
byte[] b=new byte[lenfile];
fis.read(b);
str=new String(b);
System.out.println("string is '" + str+"'");
String outputQName=args[0];
String groupId=args[2];
int seqNo= Integer.parseInt(args[3]);
boolean lastMsg= false;
if (args[4].charAt(0)=='Y') lastMsg=true;

_queueManager = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
MQQueue queue = _queueManager.accessQueue( outputQName,
openOptions,
null, // default q manager
null, // no dynamic q name
null ); // no alternate user id

MQMessage sendmsg = new MQMessage();
sendmsg.format = MQC.MQFMT_STRING;
sendmsg.feedback = MQC.MQFB_NONE;
sendmsg.messageType = MQC.MQMT_DATAGRAM;

sendmsg.setVersion(MQC.MQMD_VERSION_2);
sendmsg.replyToQueueManagerName = qManager;

sendmsg.correlationId = MQC.MQCI_NONE;
sendmsg.groupId = groupId.getBytes();
sendmsg.messageSequenceNumber = seqNo;
if (lastMsg == true)
{
sendmsg.messageFlags=MQC.MQMF_MSG_IN_GROUP + MQC.MQMF_LAST_MSG_IN_GROUP;
}
else
sendmsg.messageFlags=MQC.MQMF_MSG_IN_GROUP;
sendmsg.writeString(str);
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the defaults, same
queue.put(sendmsg, pmo);
queue.close();
_queueManager.disconnect();
}

}
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kirani
PostPosted: Wed Feb 13, 2002 10:51 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Amit,

I did a small test to see if "Commit by Group Id" feature works or not by writing a simple Message flow.

MQInput(out)->TryCatch(try)->Filter(true)->MQOutput1 (OUT1)
->Filter(false)->MQOutput2 (OUT2)
TryCatch(catch)->MQOutput3 (FAIL)

In Filter node, I am checking whether it is a last message in the group or not.

In my MQInput node, I selected these options
Transaction = Yes
Logical Order = Yes
All Messages Avail = Yes
Commit By Message Groups = Yes

Until I put a last message in the group, all messages remain in the input queue. After last message arrives, all messages are picked up by the message flow and processes them.

To test Commit By Message Groups, I inhibited Out1 for MQPUT. In this test, Last message went to FAIL queue and other messages went to OUT2 queue.

Then I modified my flow by removing TryCatch node.

MQInput(out)->Filter(true)->MQOutput1 (OUT1)
->Filter(false)->MQOutput2 (OUT2)
MQInput(failure)->MQOutput3 (FAIL)

By doing this, "Commit By Message Groups" feature worked as expected. I think, one should rollback messages to MQInput node in order to use this feature.

In your case I suspect messages are not put in a Group. I haven't looked at your program yet. I will go thru it and let your knor if there is anything to change.

Kiran
Back to top
View user's profile Send private message Visit poster's website
amigupta1978
PostPosted: Wed Feb 13, 2002 11:19 am    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

hi,
Thanks for the update..
Can u please give the version of MQSI which u r using and the platform..I am doing on MQSI v 2.0.2 on AIX 4.3.3.

Can u please also give me ur sample program to put message in the group.I will then use ur program to see whether the things work or not.

(In summary what I want have written in my program is that i am setting the message sequence number 1 ,2 and 3 and so on... I am setting the Message flags.. MSG_IN_GROUP for all the messages and I am setting the LAST_MSG_IN_GROUP for the last message and yes setting the groupID in all the messages to my group identifier)

Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kirani
PostPosted: Wed Feb 13, 2002 4:34 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Amit,

I am using MQSI V2.0.2 on Windows 2000 (CSD2). Can you try hardcoding GroupId in your java code? In my C program I was passing groupId in the argument list and it wasn't getting set properly. I am suspecting the same problem in your case.

Where can I mail you the program?

Kiran
Back to top
View user's profile Send private message Visit poster's website
amigupta1978
PostPosted: Wed Feb 13, 2002 5:18 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

Hi,
I have even tried using hardcoding group id toooo.....but still no luck....
Please mail me ur prog at amigupta1978@yahoo.com

Thnx
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Getting output after combining different input XMLs
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.