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 » Message was not in order when sends to Websphere MQ

Post new topic  Reply to topic
 Message was not in order when sends to Websphere MQ « View previous topic :: View next topic » 
Author Message
wbirookie
PostPosted: Fri Jan 16, 2009 3:02 pm    Post subject: Message was not in order when sends to Websphere MQ Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

I have an esql which send message to MQ but I open it the message was not in Order. If I send only one order, there is no problem but when I send multiple order , the sequence was not in order. Any help will be appreciated.
I supposed to get
<Envlope>
<Data>
<Header></Header>
<Detail>
<Item></Item>
<Item></Item>
</Detail>
<Header></Header>
<Detail>
<Item></Item>
</Detail>
<Header></Header>
<Detatil>
<item></Item>
<item></Item>
</Detail>
</Data>
<Envelope>
but what I am getting was
<Envlope>
<Data>
<Header></Header>
<Header></Header>
<header></Header>
<Detail>
<Item></Item>
<Item></Item>
<item></Item>
</Detail>
</Data>
<Envelope>
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 16, 2009 3:21 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

One message relying on the previous one is called "message affinity" and is considered bad for reasons including the one you've found.

WMQ does not guarantee that messages will be delivered in the order sent unless you take specific action to group and order the messages. This really only works if you have a small, discrete block of messages sent around the same time.

But you're better off removing the affinity.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 17, 2009 1:20 am    Post subject: Reply with quote

Grand High Poobah

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

And I sure hope you are not talking about a soap message because your setup is completely wrong for a soap message
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wbirookie
PostPosted: Sat Jan 17, 2009 2:28 pm    Post subject: Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

What is supposed to be the setup for SOAP Message, I am new to WBI so I know nothing about this setup. If you want I can send you the code. Thank you.
Back to top
View user's profile Send private message
zpat
PostPosted: Sun Jan 18, 2009 12:51 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

This is about the order of tags, not the order of messages.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sun Jan 18, 2009 9:54 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The order of "tags" in a message created by ESQL is exactly equivalent to the order of the statements that SET those tags...

That is, it is exactly equivalent to the chain of FIRST CHILD, NEXT SIBLING relationships in the message tree.

This is true of all message trees, regardless of whether they are created by ESQL or not, except in some specialized cases with MRM where the parser will order tags according to the order in the message definition.

ERGO, wbirookie: You are getting all of your headers first because you are setting all your headers first.
Back to top
View user's profile Send private message
wbirookie
PostPosted: Sun Jan 18, 2009 10:25 am    Post subject: ESQL Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

You're right my ESQL write the <Header> first and then <Detail>. This is true if I process one record. Heres my ESQL. Thanks for all your help.
CREATE COMPUTE MODULE OPNA_ILS_ASB_INVOICE_ACK_CreateXML
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

CALL CopyMessageHeaders();
DECLARE DateTimeStp CHARACTER;
DECLARE ackTimeStp CHARACTER;
DECLARE pattern CHARACTER 'yyyy-MM-dd"T"HH.mm.ss';
DECLARE i INT 1;
DECLARE k INT;
DECLARE Count INT;
DECLARE Dtl INT;

SET Count = CARDINALITY(Environment.IXSB005P[]);
WHILE (i<=Count) DO
CALL CopyMessageHeaders();
SET OutputRoot.XML.Envelope.PO[i].ASBPartnerID=Environment.IXSB005P[i].ASBPID;
SET OutputRoot.XML.Envelope.PO.POHeader[i].PONumber=Environment.IXSB005P[i].CUSPO;
SET OutputRoot.XML.Envelope.PO.POHeader[i].ASBOrderNumber=Environment.IXSB005P[i].ASBORD;
SET ackTimeStp = CAST(Environment.IXSB005P[i].ACKTMS AS CHARACTER);
SET DateTimeStp = SUBSTRING(ackTimeStp FROM 1 FOR 10)||'T'||SUBSTRING(ackTimeStp FROM 12 FOR 2)||':'||SUBSTRING(ackTimeStp FROM 15 FOR 2)||':'||SUBSTRING(ackTimeStp FROM 18 FOR 2);
SET OutputRoot.XML.Envelope.PO.POHeader[i].AcknowledgmentTimestamp=DateTimeStp;
SET OutputRoot.XML.Envelope.PO.POHeader[i].PODisposition=Environment.IXSB005P[i].PODISP;
SET OutputRoot.XML.Envelope.PO.POHeader[i].PODispositionComments=Environment.IXSB005P[i].POREJR;

SET k=1;
SET Dtl = CARDINALITY(Environment.IXSB006P[]);
WHILE (k<=Dtl) DO
IF( Environment.IXSB005P[i].CUSPO = Environment.IXSB006P[k].CUSPO) THEN
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].ItemNumber = Environment.IXSB006P[k].CUSITM;
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].AvyItemNumber = Environment.IXSB006P[k].AVYITM;
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].ArtworkNumber = Environment.IXSB006P[k].ARWKID;
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].ItemSequence = Environment.IXSB006P[k].ITMSEQ;
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].Qty = CAST(Environment.IXSB006P[k].POQTY as CHARACTER);
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].ItemDisposition = Environment.IXSB006P[k].ITDISP;
SET OutputRoot.XML.Envelope.PO.PODetail.Item[k].ItemDispositionComments = Environment.IXSB006P[k].ITREJR;
END IF;
SET k=k+1;
END WHILE;

SET i=i+1;
END WHILE;
PROPAGATE DELETE NONE;
RETURN FALSE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Jan 18, 2009 11:25 am    Post subject: Reply with quote

Grand High Poobah

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

Do not use the XML parser it is deprecated and will not support soap.
Use XMLNSC or XMLNS

Then on a Soap message you should always have

Declare soap NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';

OutputRoot.XMLNSC.soap:Envelope.soap:Body.messagexmlroot

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wbirookie
PostPosted: Sun Jan 18, 2009 9:53 pm    Post subject: XML Schema. Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

Below is the XML Schema, I have imported it to my Message Set Definition but its in Default Namespace, How I am going use this in my ESQL, I mean use in my Declare statement. Thanks again for all your help.
?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element name="POAcknowledgement" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:element name="ASBPartnerID" type="xs:string"/>

<xs:sequence>
<xs:element name="POAcknowledgementHeader" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="PONumber" type="xs:string"/>
<xs:element name="ASBOrderNumber" type="xs:string"/>
<xs:element name="AcknowledgementTimestamp" type="xs:dateTime"/>
<xs:element name="TradingPartnerID" type="xs:string"/>
<xs:element name="PODisposition" type="xs:string"/>
<xs:element name="PODispositionComments" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="POAcknowledgementDetail" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Item" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ItemNumber" type="xs:string"/>
<xs:element name="AvyItemNumber" type="xs:string"/>
<xs:element name="ArtworkNumber" type="xs:string"/>
<xs:element name="ItemSequence" type="xs:string"/>
<xs:element name="Qty" type="xs:string"/>
<xs:element name="ItemDisposition" type="xs:string"/>
<xs:element name="ItemDispositionComments" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>

</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Back to top
View user's profile Send private message
wbirookie
PostPosted: Sun Jan 18, 2009 9:56 pm    Post subject: Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

My goal here is to have an XML in the following order.
<Envelope>
<PO>
<ASBPartnerID>ECI </ASBPartnerID>
<POHeader>
<PONumber>10472 </PONumber>
<ASBOrderNumber>649 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-14T15:49:55</AcknowledgmentTimestamp>
<PODisposition>PASS </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>777112095000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>2904 </ArtworkNumber>
<ItemSequence>1</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>PASS </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>777112095000001</ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3190 </ArtworkNumber>
<ItemSequence>1</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>Pass </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
<ASBPartnerID>ECI </ASBPartnerID>
******New Lines of XML ******************************
<POHeader>
<PONumber>10473 </PONumber>
<ASBOrderNumber>799 </ASBOrderNumber>
<AcknowledgmentTimestamp>2009-01-15T14:44:49</AcknowledgmentTimestamp>
<PODisposition>Pass </PODisposition>
<PODispositionComments> </PODispositionComments>
</POHeader>
<PODetail>
<Item>
<ItemNumber>AVE20900 </ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3191 </ArtworkNumber>
<ItemSequence>2</ItemSequence>
<Qty>1</Qty>
<ItemDisposition>Pass </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>AVE20900 </ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3192 </ArtworkNumber>
<ItemSequence>3</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>Pass </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
<Item>
<ItemNumber>AVE20900 </ItemNumber>
<AvyItemNumber> </AvyItemNumber>
<ArtworkNumber>3192 </ArtworkNumber>
<ItemSequence>3</ItemSequence>
<Qty>2</Qty>
<ItemDisposition>Pass </ItemDisposition>
<ItemDispositionComments> </ItemDispositionComments>
</Item>
</PODetail>
</PO>
</Envelope>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 19, 2009 2:44 am    Post subject: Reply with quote

Grand High Poobah

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

This would all be part of the soap:Body...

Just define them in that order and you should be fine.
Remember to look at it as a tree and you are walking its branches in sequence...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wbirookie
PostPosted: Mon Jan 19, 2009 10:13 am    Post subject: Reply with quote

Novice

Joined: 16 Jan 2009
Posts: 13

Hi, maybe I am asking too much but how will I set my outputroot. Just give me an idea. I am really new to this area. just like how I will assigned my Header to the OutputRoot. Whats the syntax.... Let say this is my first statement. Thanks a lot.
SET OutputRoot.XMLNS.Envelope.POAcknowledgement.POAcknowledgementHeader[x].PONumber=Environment.IXSB055PX[x].CUSPO;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message was not in order when sends to Websphere MQ
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.