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 » Maintaining sequencing

Post new topic  Reply to topic Goto page 1, 2  Next
 Maintaining sequencing « View previous topic :: View next topic » 
Author Message
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:05 am    Post subject: Maintaining sequencing Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Hi friends,

We are having a logger subflow in our main flow that logs all the messages.
First we get these messages in a queue and then log it into a file.
Queue Logger subflow is part of the main flow whereas file logger flow is a diffrent flow.

Now we are logging messages at various stages in our flow and for each transaction we are generating an id which we are storing in environment variable and also passing that as one of the fields with the message which we want to log. So for one transaction basically wherever we invoke the logger subflow there will be this id which will be same throughout.

Now during production there will be several instances running. So while logging in the file we want that all the messages peratining to one transaction should be logged first and then the other transaction messages.
eg T1 M1 M2 M3 T2 M1 M2 and so on it should not be T1 M1 T2 M1 T1 M2..
T - Transaction
M- Message

Can anybody please suggest something to achieve this. The logger subflow is being used four times in the flow.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

There's no reason to use a subflow to call the logger. Just call the logger directly from the point of origination.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:09 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

We want logging to be seperate library and in case of any exceptions we want that to be handled within the message sub flow and not go back to the main flow. That is why we are using a subflow.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:12 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Logging statement is one line of code. What exceptions are you expecting from the one line of code?

Subflow execution order is not guaranteed. It's like connecting two output wires to two different paths. On one invocation Path A could be called first. On a different invocation, Path B can be called first. There is no rhyme or reason.

Logging is such a trivial exercise. You should concentrate your design and development efforts on business logic. Don't over-engineer the logging.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:12 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

We want that messages coming from an instance of a message flow needs to be written in sequence to ensure proper traceability
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Abhinay185127 wrote:
We want that messages coming from an instance of a message flow needs to be written in sequence to ensure proper traceability


Then make your logging statements directly from the point of origination; not from an over-engineered subflow.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:18 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Actaully we are having priority levels in our logging as info, debug and error which we are setting as UDP.

So the subflow based on the priority level logs the messages diffrently but as i mentioned with the same log Id. So we want while writing to file all the log messages with same log id should be written first and then only if a parallel instance is running, its log messages should be written. So how to ensure all log messages of one transaction are written together in the file
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Abhinay185127 wrote:
Actaully we are having priority levels in our logging as info, debug and error which we are setting as UDP.

So the subflow based on the priority level logs the messages diffrently but as i mentioned with the same log Id. So we want while writing to file all the log messages with same log id should be written first and then only if a parallel instance is running, its log messages should be written. So how to ensure all log messages of one transaction are written together in the file


Again : why is this so difficult:

Code:
log.info( "the string to log"); log.warning( "the string to log" );


Abhinay185127 wrote:
So how to ensure all log messages of one transaction are written together in the file


Make your logging statements directly from the point of origination; not from an over-engineered subflow.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:31 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Even if i make directly from origination my flow is

Soap Input ---> Compute ---> Soap Request ---> Compute ----> Soap Reply

So i am using the MQ logger subflow atfter compute, soap request , compute again and soap reply. So basically i will put 4 messages in the queue even if do from origination of each node.All four messages will be having one unique id.

At the same time other instance is running which is also putting messages in queue.

Now there is one other file looger flow as soon as the message will come in the queue it will be triggered. So basically the reqm is that all four log messages from first instance should come together then only other instance messages should come. We need them to be traced properly.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:33 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Abhinay185127 wrote:
Even if i make directly from origination my flow is

Soap Input ---> Compute ---> Soap Request ---> Compute ----> Soap Reply

So i am using the MQ logger subflow atfter compute, soap request , compute again and soap reply. So basically i will put 4 messages in the queue even if do from origination of each node.All four messages will be having one unique id.

At the same time other instance is running which is also putting messages in queue.

Now there is one other file looger flow as soon as the message will come in the queue it will be triggered. So basically the reqm is that all four log messages from first instance should come together then only other instance messages should come. We need them to be traced properly.


What's the point of throwing MQ messages into a queue just to write one line of code? What business value does this pattern provide compared to the complexity cost?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:44 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Its not one line of code basically but we are populating 10 other fileds apart from the message itself like provider name, consumer name, severity, log level etc
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 6:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Abhinay185127 wrote:
Its not one line of code basically but we are populating 10 other fileds apart from the message itself like provider name, consumer name, severity, log level etc


Code:
log.info( "Received a msg from " + providerName + consumerName ...


What business value does this pattern provide compared to the complexity cost?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 6:59 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Yes it is complex and we have suggested it to the client but they are adamant.
Is there a solution for such a requirement though unnecessary complex
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Jul 12, 2013 7:01 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You can solve this issue by adding more complexity. Group your messages together using the MQ grouping mechanism.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Abhinay185127
PostPosted: Fri Jul 12, 2013 7:34 am    Post subject: Reply with quote

Acolyte

Joined: 20 May 2013
Posts: 58

Can we use an easier way like resequence , sequence node maybe.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Maintaining sequencing
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.