On 5/11/06, SP Liu <[EMAIL PROTECTED]> wrote:

Thank Bruce for reply!
Previously if I disabled Geronimo's ActiveMQ,JMS client will not connect
61616 port as if ServiceMix's JMS connect factory don't start at all within
Geronimo.
Lately I follow Guillaume's insturction by embedding a
broker(tcp://localhost:61626) in servicemix.xml.Here I don't disable
Geronimo's ActiveMQ,just start a broker on port 61626 in ServiceMix so thar
it will not use Geronimo's ActiveMQ.

  <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean"
singleton="true">
    <property name="config" value="classpath:broker.xml"/>
  </bean>

        <sm:serviceunit id="jbi" depends-on="broker">
                <sm:activationSpecs>
        ...
        <bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
                <property name="connectionFactory">
                <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                        <property name="brokerURL" value="tcp://localhost:61626" 
/>
                </bean>
                </property>
        </bean>

Yes, that's good advice as the version of ActiveMQ in Geronimo 1.0 is
not new enough for ServiceMix 3.0. But Geronimo 1.2 will contain
ActiveMQ 4.0 so you'll be able to point to it when it comes out.

   Someone argue that more things can integrated into Geronimo so that I
have some interest in running ServiceMix on Geronimo, and this problem can't
be solved from then on.In the future I will mostly run ServiceMix
standalone.

Considering that ServiceMix is built specifically for integration, I
find this statemetn a bit odd. There are only so many ways to
integrate with Geronimo whereas ServiceMix offers an many, many more
methods of integration. In fact, some of us make the point that
integration with Geronimo outside of J2EE should occur via ServiceMix.

   If I add a broker in ServiceMixGBean's doStart() Method,no error/stack
trace was thrown.I found no listening in port 61626.

// code
public class ServiceMixGBean implements GBeanLifecycle, ServiceMixContainer
{
    ...
    public void doStart() throws Exception {
        ...
        try{
                if(broker == null){
                broker = new BrokerService();
                broker.addConnector("tcp://localhost:61626");
                broker.start();
                }
        }catch(Exception e){
                log.error("Cannot start broker", e);
        }

        try {
            if (container == null) {
                container = createContainer();
                container.init();
                container.start();

                // Create a JMX Connector
                JMXServiceURL url = new
JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + namingPort
                        + "/jmxrmi");
                // Create and start the RMIConnectorServer
                MBeanServer server = container.getMBeanServer();
                connectorServer =
JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
                connectorServer.start();

                //
                connectionFactory = new
ActiveMQConnectionFactor("tcp://localhost:61626");
            }
        } finally {
            Thread.currentThread().setContextClassLoader(old);
        }
    }

 Do you give me some suggestion on this method?

Take a look at the GBeans for ActiveMQ and ServiceMIx that integrate
each project into Geronimo to get an idea of how this all takes place
there. I'd point to the Subversion repositories but they're still down
at the ASF due to a kernel panic. Just take a look at
http://activemq.org/Source and http://servicemix.org/Source for the
Subversion repositories. I'll try to remember to post a link when
Subversion is back up again.

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

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://incubator.apache.org/activemq/
Apache ServiceMix - http://incubator.apache.org/servicemix/
Castor - http://castor.org/

Reply via email to