In this thread, 
http://www.nabble.com/Capture-any-message-off-the-NMR--tf1902644.html
Capture any message off the NMR? , James.Strachan was helpful in providing
direction on how to retreive any message off the NMR. He offered two
suggestions which included using the servicemix audit package and the
publish/subscribe routing mechanism.
We have attempted both solutions without any luck. The publish/subscribe
looks very exciting.
First in order for you to not have to specify a service in the
<subscriptionSpec> tag, you have to checkout TRUNK and build SNAPSHOT. In
our test, we use a Ping Pong example (based off of the file-binding
example), where Ping creates a InOut MessageExchange, sends to Pong, and
Pong sets the Out Message and replies.

Here are our expectations:
1) Our subscriber should get notified when ping sends the message and when
pong replies.
2) The InOnly MessageExchange that is sent to the subscriber should have
information pertaining to the orignial source and destination service.

Here is what we have observed:
1) The subscriber only gets notified when ping sends the message, and not
when pong replies.
2) The InOnly MessageExchange that the subscriber receives has no
information about the original source and destination.

Our team wants to capture any message being sent over the NMR and map the to
and from of the message to services on a display page. Is the pub/sub
routing going to enable us to do this? Would it be possible to include
properties in the MessageExchange indicating the original source and
destination service?

Here is the content of our servicemix.xml file:

<beans xmlns:sm="http://servicemix.apache.org/config/1.0";
         xmlns:foo="http://servicemix.org/demo";>
         
  <classpath>
    <location>.</location>
  </classpath>

    <sm:serviceunit id="jbi">
        <sm:activationSpecs>
        
            <sm:activationSpec componentName="tracer" service="foo:tracer">
                <sm:component><bean class="pp.Tracer"/></sm:component>

                <!--  lets subscribe to the output of the foo:jmsReceiver
component -->
                <sm:subscriptions>
                    <sm:subscriptionSpec service="foo:ping"/>
                </sm:subscriptions>
            </sm:activationSpec>

            <!-- pong -->
            <sm:activationSpec componentName="pong" service="foo:pong">
                <sm:component>
                    <bean class="pp.Pong"/>
                </sm:component>
            </sm:activationSpec>

            <!-- ping -->
            <sm:activationSpec componentName="ping"
                destinationService="foo:pong" service="foo:ping">
                <sm:component>
                    <bean class="pp.Ping">
                        <property name="period" value="3000" />
                    </bean>
                </sm:component>
            </sm:activationSpec>
        </sm:activationSpecs>
    </sm:serviceunit>

</beans>
-- 
View this message in context: 
http://www.nabble.com/SubscriptionSpec-Expectations-tf2046265.html#a5634521
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to