Hi Yogesh,

You can easily add a SU including your POJO using cxfse component.

To do it, first of all, you need a maven pom.xml for your SU containing :

[...]
<packaging>jbi-service-unit</packaging>
[...]
<dependency>
   <groupId>org.apache.servicemix</groupId>
   <artifactId>servicemix-cxf-se</artifactId>
   <version>3.2.2</version>
</dependency>

You place your POJO code in src/main :

public class myPOJO {

   public ResultObject myMethod(ArgObject arg) {
      ...
   }

}

In the src/main/resources, you place the xbean.xml to use your POJO via cxf-se 
component :

<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0";
       xmlsns:myService="http://myservice";>
   <cxfse:endpoint>
      <cxfse:pojo>
         <bean class="myPOJO"/>
      </cxfse:pojo>
   </cxfse:endpoint>
</beans>

Regards

On Wednesday 29 October 2008 - 12:33, ychawla wrote:
> 
> Hello All,
> I am a service mix newbie and am currently using version 3.2.2.  I currently
> have an HTTP endpoint is connected to a EIP recipient list.  That list sends
> the message out to a JMS queue, sends a transformed message to another JMS
> and dumps it out to a folder.  All done without writing any Java code. 
> Pretty cool!
> 
> I am at the next phase now and have two questions:
> 
> 1) I want to take this message and send it off to a custom POJO which will
> stash in a database.  From what I read, I can use servicemix-cxf se,
> servicemix-bean or other components.  According to this FAQ:
> http://servicemix.apache.org/should-i-create-my-own-jbi-components.html
> 
> I should not be creating a JBI component.  That makes sense to me, but what
> existing component should I use?  I looked into servicemix-cxf-se but that
> seemed to create a web service.  So I figured servicemix-bean would be more
> appropriate.  I am confused which direction to go.
> 
> 2) Now that I have message sitting on a JMS queue, I want to do something
> with them.  For example, I want to have a POJO that pops the latest message
> off a queue and processes it.  I don't want to listen to the queue and get
> any new messages that appear, but retrieve message as consumers demand them. 
> Should I just write a java application in spring that listens to a queue? 
> Is there a better way to retrieve these message in servicemix?
> 
> Thanks,
> Yogesh
> -- 
> View this message in context: 
> http://www.nabble.com/Connecting-POJOs-to-Service-Mix-tp20234290p20234290.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré (Nanthrax)
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net
[EMAIL PROTECTED]
PGP : 17D4F086

Reply via email to