Appending endpoint: infront of the uri finally made it work. NMR notifications can be sent to services or endpoints. If the notification is sent to a service, then append service: infront of the uri. If sending to an endpoint add endpoint:
For a service, even though there can be a http endpoint or other bc components, the notifications are sent to the SE endpoint. Hence the service name and endpoint information should be added to this. For examples, to a send a nmr notification to a JSR181 web service, in the jsr181 endpoint, specify the service name and then use this in the uri. Nithya nvijayak wrote: > > Hi, > > Please help. I am having problems resolving consumer endpoint in a wsn > example. I copied the org.apache.servicemix.components.util.TraceComponent > and created a ListenerBean which is behaving as the wsn consumer. The > xbean.xml for this is follows: > > <beans xmlns:bean="http://servicemix.apache.org/bean/1.0" > xmlns:consumer="http://servicemix.apache.org/examples/consumer"> > <bean:endpoint service="consumer:ListenerService" endpoint="listen" > bean="#listenerBean"/> > <bean id="listenerBean" > class="org.apache.servicemix.examples.consumer.ListenerBean"/> > </beans> > > The notifiaction broker is deployed as shown in the wsn-httpbinding > example. I subscribed the ListenerBean as a consumer to topic "myTopic" by > sending the following message to the broker and got a subscription > response. > > <?xml version="1.0" encoding="UTF-8"?> > <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" > xmlns:wsa="http://www.w3.org/2005/08/addressing"> > > <env:Body> > <wsnt:Subscribe> > <wsnt:ConsumerReference> > > <wsa:Address>http://servicemix.apache.org/examples/consumer/ListenerService/listen/</wsa:Address> > </wsnt:ConsumerReference> > <wsnt:Filter> > <wsnt:TopicExpression > Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple"> > myTopic > </wsnt:TopicExpression> > </wsnt:Filter> > </wsnt:Subscribe> > </env:Body> > </env:Envelope> > > > But when I send a notify message to the broker on "myTopic" it results in > the following error. > > > WARN - DeliveryChannelImpl - Error calling listener: null > java.lang.NullPointerException > at > org.apache.servicemix.jbi.monitoring.StatisticsService.onExchangeAcce > pted(StatisticsService.java:307) > at > org.apache.servicemix.jbi.monitoring.StatisticsService$3.exchangeAcce > pted(StatisticsService.java:186) > at > org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun > d(DeliveryChannelImpl.java:598) > at > org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo > w.java:170) > at > org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j > ava:167) > at > org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav > a:134) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec > utor.java:650) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor > .java:675) > at java.lang.Thread.run(Thread.java:595) > ERROR - HttpComponent - Error processing exchange InOnly[ > id: ID:128.107.143.159-117f626add0-18:1 > status: Active > role: provider > endpoint: > http://servicemix.apache.org/examples/crscon/ListenerService/listen/ > > in: <?xml version="1.0" encoding="UTF-8"?><ns2:Notify > xmlns:ns2="http://docs.o > asis-open.org/wsn/b-2" xmlns="http://www.w3.org/2005/08/addressing" > xmlns:ns3="h > ttp://docs.oasis-open.org/wsrf/bf-2" > xmlns:ns4="http://docs.oasis-open.org/wsn/t > -1"><ns2:NotificationMessage><ns2:Topic>myTopic</ns2:Topic><ns2:Message><hello > x > mlns="" > xmlns:ns5="http://www.w3.org/2005/08/addressing">world</hello></ns2:Mess > age></ns2:NotificationMessage></ns2:Notify> > ] > java.lang.Exception: Invalid status response: 404 > at > org.apache.servicemix.http.processors.ProviderProcessor.process(Provi > derProcessor.java:181) > at > org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi > feCycle.java:538) > at > org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async > BaseLifeCycle.java:490) > at > org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife > Cycle.java:46) > at > org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun > d(DeliveryChannelImpl.java:610) > at > org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo > w.java:170) > at > org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j > ava:167) > at > org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav > a:134) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec > utor.java:650) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor > .java:675) > at java.lang.Thread.run(Thread.java:595) > > Nithya > -- View this message in context: http://www.nabble.com/problem-resolving-endpoint-uri-tp15345958s12049p15843126.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
