On Sat, 2009-11-14 at 17:22 -0800, youhaodeyi wrote: > Yes I mean plug-in the xbean.xml. > > What I want to do is to make the service url be configured. > In addition, can I use Destination to send message to a service by service > name or endpoint name not url? I have a service doesn't have an URL. How can > I send message to this service?
what do you mean by service that doesn't have URL?? Each service is identified on NMR by uri - if you use form of urn:foo:bar:MyService:MyEndpoint - then you can also use it in Destination configuration. About configuration in xbean.xml - I think it's easiest to inject just the URI of target service - e.g. have destinationServiceURI property (string) in bean implementing MessageExchangeListener, and then just use it to create destination br, maciek > thanks, > > Zhao Yi > > > Maciek Prochniak wrote: > > > > it's in org.apache.servicemix.bean.support package (servicemix-bean). > > > > What do you mean by 'plugin-in in configuration file'? > > Define it in xbean.xml? > > > > br, > > maciek > > > > > > On Sat, 14 Nov 2009 02:57:44 -0800 (PST), youhaodeyi > > <[email protected]> > > wrote: > >> Where is DestinationImpl defined? Can I plug-in it in the configuration > >> file? > >> > >> > >> Maciek Prochniak wrote: > >>> > >>> Well, guess you could try to do sth like: > >>> > >>> Destination target = new > >>> DestinationImpl("service:http://the.service.you.want.to.route", > >>> beanEndpoint); > >>> > >>> where the beanEndpoint is the bean created by > >>> > >>> <bean:endpoint service="uncompress_service" > >>> endpoint="uncompress_service_endpoint" bean="#receiver" /> > >>> > >>> but it's kind of clumsy, and IMHO it's far easier to use camel for such > >>> purpose > >>> > >>> br, > >>> maciek > >>> > >>> On Wed, 2009-10-28 at 17:48 -0700, youhaodeyi wrote: > >>>> Hello, > >>>> > >>>> Thanks for your information. > >>>> > >>>> In this way, I have to configure the target service in code which can't > >>>> be > >>>> modified at runtime. Can I configure this in a configuration? Does > >>>> servicemix support something like outbound router? > >>>> > >>>> Regards > >>>> > >>>> > >>>> Maciek Prochniak wrote: > >>>> > > >>>> > Hello, > >>>> > we are using the following in such situation: > >>>> > > >>>> > Instance variables: > >>>> > > >>>> > @Resource > >>>> > private DeliveryChannel channel; > >>>> > > >>>> > @ExchangeTarget(uri="service:http://the.service.you.want.to.route") > >>>> > private Destination target; > >>>> > > >>>> > routing to another service: > >>>> > NormalizedMessage nm = target.createMessage(); > >>>> > nm.setContent(new StringSource("<bububub/>")); > >>>> > nm.setProperty("fileId", "parara"); > >>>> > //you receive Future<NormalizedMessage> object > >>>> > target.send(nm); > >>>> > > >>>> > There are some caveats in this approach: > >>>> > 1. target.createMessage() can only create InOut message exchanges. > >>>> > 2. onMessageExchange method is invoked in different contexts, this is > >>>> > the code that finally worked for us: > >>>> > public void onMessageExchange(MessageExchange me) throws > >>>> > MessagingException { > >>>> > //our bean is receiving request, otherwise it's reply from > >>>> > target.send > >>>> > if (me.getRole().equals(Role.PROVIDER)) { > >>>> > //do the real stuff > >>>> > process(); > >>>> > } > >>>> > //we have to acknowledge - otherwise e.g. memory leaks may happen > >>>> > > >>>> > if (me.getStatus().equals(ExchangeStatus.ACTIVE)) { > >>>> > me.setStatus(ExchangeStatus.DONE); > >>>> > channel.send(me); > >>>> > } > >>>> > } > >>>> > > >>>> > hope this helps > >>>> > > >>>> > br, > >>>> > maciek > >>>> > > >>>> > > >>>> > > >>>> > On Mon, 2009-10-26 at 23:23 -0700, youhaodeyi wrote: > >>>> >> Hi, > >>>> >> > >>>> >> This is my xbean.xml file: > >>>> >> > >>>> >> <beans> > >>>> >> > >>>> >> <bean:endpoint service="uncompress_service" > >>>> >> endpoint="uncompress_service_endpoint" > >>>> >> bean="#receiver" /> > >>>> >> > >>>> >> <bean id="receiver" > > class="com.ge.med.ric.service.UncompressService" > >>>> /> > >>>> >> > >>>> >> </beans> > >>>> >> > >>>> >> The bean implements MessageExchangeListener interface. I want to > >>>> >> route > >>>> >> the > >>>> >> message to another bean service. > >>>> >> > >>>> >> > >>>> >> > >>>> >> > >>>> >> Jean-Baptiste Onofré wrote: > >>>> >> > > >>>> >> > Your bean components implements which interface: listener, > > consumer > >>>> ? > >>>> >> > ------Original Message------ > >>>> >> > From: youhaodeyi > >>>> >> > To: [email protected] > >>>> >> > Subject: Re: Where does DeliveryChannel.send() to? > >>>> >> > Sent: Oct 27, 2009 07:08 > >>>> >> > > >>>> >> > > >>>> >> > Hi, > >>>> >> > > >>>> >> > I define a bean component and want to route this message to > > another > >>>> SU. > >>>> >> > How > >>>> >> > can I set its target service? > >>>> >> > > >>>> >> > thanks > >>>> >> > > >>>> >> > > >>>> >> > Jean-Baptiste Onofré wrote: > >>>> >> >> > >>>> >> >> Hi, > >>>> >> >> > >>>> >> >> DeliveryChannel is part of JBI specification. So when you call > >>>> send() > >>>> >> >> method on it, the exchange containing the normalized message is > >>>> send > >>>> >> into > >>>> >> >> the Normalized Router (NMR). The message is routed to the > >>>> destination > >>>> >> >> using exchange properties (target service, target endpoint, MEP, > >>>> ...). > >>>> >> >> > >>>> >> >> Regards > >>>> >> >> JB > >>>> >> >> ------Original Message------ > >>>> >> >> From: youhaodeyi > >>>> >> >> To: [email protected] > >>>> >> >> ReplyTo: [email protected] > >>>> >> >> Subject: Where does DeliveryChannel.send() to? > >>>> >> >> Sent: Oct 27, 2009 02:17 > >>>> >> >> > >>>> >> >> > >>>> >> >> When I call DeliveryChannel.send(), where does the message go? > > how > >>>> can > >>>> >> I > >>>> >> >> set > >>>> >> >> the destination? > >>>> >> >> > >>>> >> >> thanks. > >>>> >> >> -- > >>>> >> >> View this message in context: > >>>> >> >> > >>>> >> > >>>> > > http://www.nabble.com/Where-does-DeliveryChannel.send%28%29-to--tp26070654p26070654.html > >>>> >> >> Sent from the ServiceMix - User mailing list archive at > >>>> >> >> Nabble.com. > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> > > >>>> >> > -- > >>>> >> > View this message in context: > >>>> >> > > >>>> >> > >>>> > > http://www.nabble.com/Where-does-DeliveryChannel.send%28%29-to--tp26070654p26072560.html > >>>> >> > Sent from the ServiceMix - User mailing list archive at > > Nabble.com. > >>>> >> > > >>>> >> > > >>>> >> > > >>>> >> > > >>>> >> > >>>> > > >>>> > > >>>> > > >>>> > >>> > >>> > >>> > > > > >
