You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Justin Stewart <ju...@lmco.com> on 2007/05/02 15:59:14 UTC

Routing from Drools service unit to servicemix-bean service unit

Hi, all.
I'm trying to use a Drools route command to route a message to a specific
operation within a servicemix-bean based service unit.  I think I am not
getting the URI right.  From within the Drools file, I route as shown below:

     jbi.route("endpoint:urn:myNamespace:myService:endpoint");

This isn't working, but that's not really what I would like anyway.  I would
like to route to a specific operation within the myService servicemix-bean
service unit.  The operation is defined as shown:

	@Operation(name = "operationInOut")
	public void myExchangeMethod1(MessageExchange messageExchange)
			throws MessagingException {
		// Ensure that the Message Exchange is appropriate 
		if (!(messageExchange instanceof InOut)) {
			log.error("Didn\'t receive expected InOut message: "
					+ messageExchange);
			throw new MessagingException("");
		}

		// Handle the request
		InOut io = (InOut) messageExchange;
		log.info("operationInOut() called with exchange: " + messageExchange);
		
		// Create the response
		NormalizedMessage message = io.createMessage();
		message.setContent(new StringSource("<hello>back</hello>"));
		io.setOutMessage(message);
		
		// Send the response
		channel.send(messageExchange);
	}

Does anyone know how I can specify a specific bean operation in a URI to be
used in Drools?

Thanks for the help.
Justin
-- 
View this message in context: http://www.nabble.com/Routing-from-Drools-service-unit-to-servicemix-bean-service-unit-tf3680741s12049.html#a10286391
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Routing from Drools service unit to servicemix-bean service unit

Posted by Gert Vanthienen <ge...@skynet.be>.
Justin,

On (1), you'll find some more information about these URIs.  I think 
that for your case, it should look something like 
http://foo.bar/MyInterface/MyOperation

Gert

(1) http://incubator.apache.org/servicemix/uris.html

Justin Stewart wrote:
> Hi, all.
> I'm trying to use a Drools route command to route a message to a specific
> operation within a servicemix-bean based service unit.  I think I am not
> getting the URI right.  From within the Drools file, I route as shown below:
>
>      jbi.route("endpoint:urn:myNamespace:myService:endpoint");
>
> This isn't working, but that's not really what I would like anyway.  I would
> like to route to a specific operation within the myService servicemix-bean
> service unit.  The operation is defined as shown:
>
> 	@Operation(name = "operationInOut")
> 	public void myExchangeMethod1(MessageExchange messageExchange)
> 			throws MessagingException {
> 		// Ensure that the Message Exchange is appropriate 
> 		if (!(messageExchange instanceof InOut)) {
> 			log.error("Didn\'t receive expected InOut message: "
> 					+ messageExchange);
> 			throw new MessagingException("");
> 		}
>
> 		// Handle the request
> 		InOut io = (InOut) messageExchange;
> 		log.info("operationInOut() called with exchange: " + messageExchange);
> 		
> 		// Create the response
> 		NormalizedMessage message = io.createMessage();
> 		message.setContent(new StringSource("<hello>back</hello>"));
> 		io.setOutMessage(message);
> 		
> 		// Send the response
> 		channel.send(messageExchange);
> 	}
>
> Does anyone know how I can specify a specific bean operation in a URI to be
> used in Drools?
>
> Thanks for the help.
> Justin
>