You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by youhaodeyi <yo...@gmail.com> on 2008/04/25 03:00:01 UTC

How can I integrate ServiceMix into my application?

How can I integrate ServiceMix into my application? This means I don't need
to start a ServiceMix server. I put it into Java Application.
-- 
View this message in context: http://www.nabble.com/How-can-I-integrate-ServiceMix-into-my-application--tp16872530p16872530.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How can I integrate ServiceMix into my application?

Posted by youhaodeyi <yo...@gmail.com>.
Thanks. 



bsnyder wrote:
> 
> On Thu, Apr 24, 2008 at 7:00 PM, youhaodeyi <yo...@gmail.com> wrote:
>>
>>  How can I integrate ServiceMix into my application? This means I don't
>> need
>>  to start a ServiceMix server. I put it into Java Application.
> 
> Lot's of people embed ServiceMix inside of Java applications. ActiveMQ
> and ServiceMix were both designed to be embedded very easily. The
> following is an example of starting up ActiveMQ and ServiceMix using
> Java code:
> 
> // Configure an ActiveMQ broker on localhost:61616 and start it
> BrokerFactoryBean bfb = new BrokerFactoryBean(new
> ClassPathResource("path/to/activemq.xml"));
> bfb.afterPropertiesSet();
> BrokerService broker = bfb.getBroker();
> broker.start();
> 
> // Create and configure a ServiceMix container
> JBIContainer container = new JBIContainer();
> container.setEmbedded(true);
> container.setUseMBeanServer(false);
> container.setCreateMBeanServer(false);
> container.setCreateJmxConnector(false);
> container.setRootDir("path/to/root/dir");
> container.setMonitorInstallationDirectory(false);
> container.setNamingContext(new InitialContext());
> container.setTransactionManager(new GeronimoPlatformTransactionManager());
> ...
> container.init();
> container.start();
> 
> This example is very basic and is meant to just get you started. Also,
> this is just one example of how to achieve this. There are many, many
> other possibilities.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-integrate-ServiceMix-into-my-application--tp16872530p16891064.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How can I integrate ServiceMix into my application?

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Apr 24, 2008 at 7:00 PM, youhaodeyi <yo...@gmail.com> wrote:
>
>  How can I integrate ServiceMix into my application? This means I don't need
>  to start a ServiceMix server. I put it into Java Application.

Lot's of people embed ServiceMix inside of Java applications. ActiveMQ
and ServiceMix were both designed to be embedded very easily. The
following is an example of starting up ActiveMQ and ServiceMix using
Java code:

// Configure an ActiveMQ broker on localhost:61616 and start it
BrokerFactoryBean bfb = new BrokerFactoryBean(new
ClassPathResource("path/to/activemq.xml"));
bfb.afterPropertiesSet();
BrokerService broker = bfb.getBroker();
broker.start();

// Create and configure a ServiceMix container
JBIContainer container = new JBIContainer();
container.setEmbedded(true);
container.setUseMBeanServer(false);
container.setCreateMBeanServer(false);
container.setCreateJmxConnector(false);
container.setRootDir("path/to/root/dir");
container.setMonitorInstallationDirectory(false);
container.setNamingContext(new InitialContext());
container.setTransactionManager(new GeronimoPlatformTransactionManager());
...
container.init();
container.start();

This example is very basic and is meant to just get you started. Also,
this is just one example of how to achieve this. There are many, many
other possibilities.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/