Hello,
I am trying to write a component which sends the message to the broker but I
am getting some exception.
javax.jbi.messaging.MessagingException: In not supported
at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(MessageExchangeImpl.java:308)
at com.hp.MyComponent.onMessageExchange(MyComponent.java:18)
at
org.apache.servicemix.components.util.ComponentAdaptorMEListener.onMessageExchange(ComponentAdaptorMEListener
.java:46)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:622)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:168)
at
org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow.access$301(JMSFlow.java:72)
at
org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow$5.run(JMSFlow.java:534)
at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
public class MyComponent extends PojoSupport implements
MessageExchangeListener {
public void onMessageExchange(MessageExchange exchange)
throws MessagingException {
// TODO Auto-generated method stub
System.out.println("inside onMessageExchange ");
NormalizedMessage msg = exchange.createMessage();
exchange.setMessage(msg,"in");
msg.setContent(new StringSource("Hey! This is my ws-notification
message"));
done(exchange);
}
}
I have also attached the servicemix xml file. (servicemix_test.xml)
http://www.nabble.com/user-files/235943/servicemix_test.xml
servicemix_test.xml . Please help me.
Thanks,
Pradeep
gnodet wrote:
>
> On 9/11/06, pradeep <[EMAIL PROTECTED]> wrote:
>>
>>
>> Thank you verry much. I got it now.
>> In the example the message passed by quartz component is published to the
>> topic. So in real life, some component of mine will publish the message
>> to
>> org.apache.servicemix.wsn.spring.PublisherComponent and gets delivered to
>> the subscribers.
>
>
> This is the easiest way, unless you really want to send publishing
> requests
> to the broker and deal with ws-notification directly.
>
> Is this dynamic way of sending/receiving messages
>> http://servicemix.goopen.org/site/ws-notification.html
>
>
> This is one of the way to do it if you are inside the jbi bus.
> The benefit is that you don't have to deal with the xml syntax at all.
> If you are outside the jbi bus, you need to create an http binding
> for example (as shown in the ws-notification example) and send
> http requests.
>
> I will clean up the xml files when I get time. Thanks again,Pradeep
>
>
> Feel free to add / comment the wiki to improve the docs.
> I will start a more in-depth review of the WS-Notification component
> itself.
>
> gnodet wrote:
>> >
>> > On 9/11/06, pradeep <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> Thanks Guillaume Nodet. It has helped me to understand the example
>> much
>> >> better but I have more questions :)
>> >>
>> >> 1. You have mentioned that "...WS-Notification can also be used in a
>> more
>> >> dynamic way by sending requests the the WS-Notification Broker to
>> create
>> >> publishers and subscribers..".Can you please tell me how to do that ?
>> >
>> >
>> > The best way would be to read the WS-Notification spec and send the
>> > requests
>> > to the JBI endpoint. The only particular thing is how the EPR for
>> > publishers
>> > and subscribers are created. They will use the uri mechanism used in
>> the
>> > example:
>> > namespace / service / endpoint
>> >
>> > 2. "...instance1 is part of the cluster but does not have any WS-N
>> >> subscribers or publishers". My question is - why do we need this
>> >> instance.
>> >> What is that you are trying to demonstarte ?
>> >
>> >
>> > It's not used and maybe should be removed.
>> >
>> > 3. Can someone explain me this
>> >> <bean class="org.quartz.JobDetail">
>> >> <property name="name" value="My Example Job"/>
>> >> <property name="group" value="ServiceMix"/>
>> >> </bean>
>> >
>> >
>> > These properties are needed for Quartz. AFAIK, they uniquely identify
>> the
>> > Job
>> > but are not used by ServiceMix.
>> >
>> > 4. org.apache.servicemix.wsn.spring.PublisherComponent is the
>> publisher.
>> > How
>> >> do I write a custom publisher ?
>> >
>> >
>> > You don't really need to, as the PublisherComponent is a proxy. It
>> > receive
>> > an
>> > incoming xml message and publish it on the configured topic. If you
>> > really
>> > want to write your own, take a look at the code for this component.
>> >
>> > 5. In the example "wsn-message.xml" is the XML message passed. Who
>> reads
>> >> this XML message.Is it the publisher component ?
>> >
>> >
>> > No one. This xml is not used. The quartz component send a message to
>> the
>> > publisher,
>> > which is wrapped in a publish request and sent to the notification
>> broker.
>> >
>> > 6. In the consumer side what does the component
>> >> "org.apache.servicemix.tck.ReceiverComponent" do ?
>> >
>> >
>> > Nothing it seems.
>> >
>> > If you have some time, please clean and comment the configuration files
>> > and
>> > raise a JIRA
>> > with your patch.
>> >
>> > On a side note, most of the ws-notification component have an xbean
>> syntax
>> > which is not
>> > used in this example.
>> >
>> > Thanks,
>> >> Pradeep
>> >>
>> >>
>> >>
>> >>
>> >> gnodet wrote:
>> >> >
>> >> > Just created this page which should help you understand the basics
>> of
>> >> this
>> >> > example.
>> >> > This is just a draft and should be enhanced in the future.
>> >> > See
>> >> > http://servicemix.goopen.org/sm30ug/ws-notification-clustered.html
>> >> >
>> >> > On 9/10/06, pradeep <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >>
>> >> >> I am experimenting with ws-notifcation example provided with the
>> >> >> download.
>> >> >> I
>> >> >> haven't understood how it is works, so questions
>> >> >> 1. What is the purpose of running instance1/servicemix1.xml.What
>> does
>> >> it
>> >> >> do
>> >> >> ?
>> >> >> 2. what does org.apache.servicemix.wsn.spring.PublisherComponent do
>> ?
>> >> Is
>> >> >> it
>> >> >> the publisher? What about
>> >> >> org.apache.servicemix.wsn.spring.WSNSpringComponent ?
>> >> >> 3. sorry if this is stupid but if I need to publish notification
>> what
>> >> >> are
>> >> >> the steps.
>> >> >> a.replace
>> org.apache.servicemix.wsn.spring.PublisherComponentwith
>> >> my
>> >> >> own
>> >> >> implmentaion? if yes what has to be done ?
>> >> >> b. Or reuse org.apache.servicemix.wsn.spring.PublisherComponent ?
>> If
>> >> >> yes,
>> >> >> how do I write the code to send notifications ?
>> >> >>
>> >> >> 4. Same question as 3 for the consumer (instance 2 in the example
>> ).
>> >> More
>> >> >> details required for org.apache.servicemix.tck.ReceiverComponent.
>> >> >>
>> >> >> If someone could explain me the working of the example wiht
>> expnantion
>> >> of
>> >> >> the servicemix.xml's it would be great. I have to admit that I am
>> >> toally
>> >> >> confused. Thanks for your help.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Confused-about-ws-notification-tf2247458.html#a6233049
>> >> >> Sent from the ServiceMix - User forum at Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Cheers,
>> >> > Guillaume Nodet
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Confused-about-ws-notification-tf2247458.html#a6241299
>> >> Sent from the ServiceMix - User forum at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Confused-about-ws-notification-tf2247458.html#a6242722
>> Sent from the ServiceMix - User forum at Nabble.com.
>>
>>
>
>
> --
> Cheers,
> Guillaume Nodet
>
>
--
View this message in context:
http://www.nabble.com/Confused-about-ws-notification-tf2247458.html#a6243877
Sent from the ServiceMix - User forum at Nabble.com.