You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Stefan Klinger <kl...@cs.york.ac.uk> on 2006/04/07 09:54:55 UTC

Audit / Log Book of messages

Hello,

For my application, I have the need to keep a log of all messages that 
pass via the ESB. How would one generally go about it? My idea is to use 
message queues and have a LogComponent listening on all the queues for 
messages and writing them to a database. Or would it be better to have 
one LogComponent for each type of message? For me personally it would be 
good if I could specify two destination endpoints from one service, one 
for the logging and the other one for the "working", and the message 
would be duplicated to both endpoints. But, I guess, that's what you use 
message queues for.

Any comments are most appreciated.

Stefan

Re: Audit / Log Book of messages

Posted by Stefan Klinger <kl...@cs.york.ac.uk>.
Guillaume,
Thanks a lot.
Stefan

Guillaume Nodet wrote:

>ServiceMix container can register listeners for events.
>Take a look at http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/event/package-frame.html
>I guess you will be interested in
>http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/event/ExchangeListener.html
>
>You may also want to take a look at the existing derived classes in
>the audit package:
>http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/audit/package-frame.html
>There is already  a class that logs all messages to a database.  In
>addition, it supports querying the database for messages and you can
>event resend a given message through the bus (this can be usefull when
>an exchange has failed and you want to fix it and retry).
>The only downside is that to keep the whole exchange, a blob is used
>instead of a complex object mapping, so that the exchanges can not be
>read easily from an oustide app.
>
>A new interface has been recently added which may be useful for
>listeners: org.apache.servicemix.jbi.container.ContainerAware which is
>not used yet by the audit listeners (but should be).  To register
>listeners in your xml configuration file, take a look at
>http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml?rev=391714
>
>Hope this helps,
>Guillaume Nodet
>
>On 4/7/06, Stefan Klinger <kl...@cs.york.ac.uk> wrote:
>  
>
>>Hello,
>>
>>For my application, I have the need to keep a log of all messages that
>>pass via the ESB. How would one generally go about it? My idea is to use
>>message queues and have a LogComponent listening on all the queues for
>>messages and writing them to a database. Or would it be better to have
>>one LogComponent for each type of message? For me personally it would be
>>good if I could specify two destination endpoints from one service, one
>>for the logging and the other one for the "working", and the message
>>would be duplicated to both endpoints. But, I guess, that's what you use
>>message queues for.
>>
>>Any comments are most appreciated.
>>
>>Stefan
>>
>>    
>>


Re: Audit / Log Book of messages

Posted by Guillaume Nodet <gn...@gmail.com>.
ServiceMix container can register listeners for events.
Take a look at http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/event/package-frame.html
I guess you will be interested in
http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/event/ExchangeListener.html

You may also want to take a look at the existing derived classes in
the audit package:
http://servicemix.codehaus.org/maven/servicemix-core/apidocs/org/apache/servicemix/jbi/audit/package-frame.html
There is already  a class that logs all messages to a database.  In
addition, it supports querying the database for messages and you can
event resend a given message through the bus (this can be usefull when
an exchange has failed and you want to fix it and retry).
The only downside is that to keep the whole exchange, a blob is used
instead of a complex object mapping, so that the exchanges can not be
read easily from an oustide app.

A new interface has been recently added which may be useful for
listeners: org.apache.servicemix.jbi.container.ContainerAware which is
not used yet by the audit listeners (but should be).  To register
listeners in your xml configuration file, take a look at
http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/servicemix/trunk/servicemix-jsr181/src/test/resources/org/apache/servicemix/jsr181/spring.xml?rev=391714

Hope this helps,
Guillaume Nodet

On 4/7/06, Stefan Klinger <kl...@cs.york.ac.uk> wrote:
> Hello,
>
> For my application, I have the need to keep a log of all messages that
> pass via the ESB. How would one generally go about it? My idea is to use
> message queues and have a LogComponent listening on all the queues for
> messages and writing them to a database. Or would it be better to have
> one LogComponent for each type of message? For me personally it would be
> good if I could specify two destination endpoints from one service, one
> for the logging and the other one for the "working", and the message
> would be duplicated to both endpoints. But, I guess, that's what you use
> message queues for.
>
> Any comments are most appreciated.
>
> Stefan
>