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 » Generating report messages when writing to a database

Post new topic  Reply to topic
 Generating report messages when writing to a database « View previous topic :: View next topic » 
Author Message
thyssen
PostPosted: Wed Jun 06, 2007 12:02 am    Post subject: Generating report messages when writing to a database Reply with quote

Novice

Joined: 07 May 2007
Posts: 13

Hello,

we intend to establish a simple logging system setting MQMD.Report options in ESQL. The broker should write all report messages to a central ReplyToQueue ('TRACKING_REPORTS'). Our ESQL code looks something like this:


CREATE COMPUTE MODULE RequestReports
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot=InputRoot;
SET OutputRoot.MQMD.Report=MQRO_PASS_CORREL_ID + MQRO_COA_WITH_DATA + MQRO_PAN + MQRO_NAN;
SET OutputRoot.MQMD.ReplyToQ='TRACKING_REPORTS';
SET OutputRoot.MQMD.ReplyToQMgr='QM1';

RETURN TRUE;
END;
END MODULE;

This works as expected for message flows like "MQInput --> Compute --> MQOutput". However, we also want to generate report messages automatically when writing messages to a database. Message Flows then look like "MQInput --> Compute --> Database-Node".

Any Ideas for that?

Kind Regards,
Dietmar
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed Jun 06, 2007 12:18 am    Post subject: Re: Generating report messages when writing to a database Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

In your exaple you created request for report.
These reports will be generated in specified situations.
...
To generate report in your flow you will have to place compute node after Database-Node and in this Compute node generate report manually (message format report +report option + MQMD+ additional informations).
Then this node should ne wired to MQOutput node to send message.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
thyssen
PostPosted: Wed Jun 06, 2007 12:31 am    Post subject: Reply with quote

Novice

Joined: 07 May 2007
Posts: 13

Sure, we could do someting like MQInput --> Database --> Compute (set report options) --> MQOutput.

But can't we provoke the same behaviour (maybe using some MQMD report options) when the message is committed to the database? Actually we try to avoid using dummy output queues just for log purposes.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed Jun 06, 2007 12:40 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

thyssen wrote:
Sure, we could do someting like MQInput --> Database --> Compute (set report options) --> MQOutput.

But can't we provoke the same behaviour (maybe using some MQMD report options) when the message is committed to the database? Actually we try to avoid using dummy output queues just for log purposes.



But it is not possible ?
Who should send this report message, database ?

To provoke QMGR to send report message there should be MQ event , COA, COD, ....

Here you have database event, so you have to generate this report by your own. Somewhere you have to place code which generate report message. Your flow is good place to do it. I don't know better way.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
marcin.kasinski
PostPosted: Wed Jun 06, 2007 12:53 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Hi, I have another question

Isn't it better to move this report database functionality to database side ?

Maybe you should use your code above to log MQ activity and database trigger to log database activity ?

What do you think about that ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
thyssen
PostPosted: Wed Jun 06, 2007 1:25 am    Post subject: Reply with quote

Novice

Joined: 07 May 2007
Posts: 13

Would you recommend a central logging solution? Maybe a common subflow to which the report option are passed as parameters and which writes to a dummy queue to provoke the report messages? This flow could then be added after each MQOutput or Database node of the main flow. Any experiences how to handle these logging affairs?

Kind Regards,
Dietmar
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 06, 2007 1:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So what you're really trying to do is make your logging into a synchronous process.

Use MQ, use a request/reply messaging paradigm, and have your common logging subflow wait for the reply.

MQInput->(subflow)->rest of the real work

(Subflow)Input->Compute(build log message, set request options)->MQOutput->MQGet->Compute->Output
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed Jun 06, 2007 1:55 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

thyssen wrote:
Would you recommend a central logging solution? Maybe a common subflow to which the report option are passed as parameters and which writes to a dummy queue to provoke the report messages? This flow could then be added after each MQOutput or Database node of the main flow. Any experiences how to handle these logging affairs?

Kind Regards,
Dietmar


Are you going to implement it on PRD or you are planning to test your environment or something else?

Why do you need such logging ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
thyssen
PostPosted: Wed Jun 06, 2007 2:42 am    Post subject: Reply with quote

Novice

Joined: 07 May 2007
Posts: 13

Thank you for your replies so far. We are still in the design process of our logging solution. What we are looking for is a very slim solution without explizit logging to a logging database via SQL inserts from within the message flows themselfs.

Messages are normally send once to a local queue on our broker. From there they are distributed to other local queues on which several message flows are listening. We have to track whether each of these flows has processed the original message. Therefore each flow should provoke report messages which are than gathered in a central logging queue. The process of generating logging messages should be equal for queues as receivers of the incoming message as well as for databases at the end of the flows.

Kind regards,
Dietmar
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 » Generating report messages when writing to a database
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.