You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jainmanglesh <ja...@rediffmail.com> on 2013/01/23 13:44:39 UTC

activemq in servicemix

Hi,
I have a bundle with my implementation of managing messaging with activemq
queue. I want to deploy this bundle on servicemix however I dont know the
broker URL which I should use. when I deployed this on standalone activemq
server I used following URL for brokerURL: tcp://localhost:61616.

However this does not seem to work (or I think I might me missing some
config to tell servicemix to use this url as activemq broker URL).

I can see activemq as installed when i run features:list command on
servicemix.

Can anyone please help me in finding how/what broker URL I should use to
correctly deploy my application on servicemix.



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-in-servicemix-tp4662070.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq in servicemix

Posted by jainmanglesh <ja...@rediffmail.com>.
Thank you very much Christian,

I was able to connect to external activemq instance.

I think I had some missing repo entries in org.ops4j.pax.url.mvn file under
etc in servicemix. I added those repo entries and it was able to connect the
same URL. I am not sure if this was the only reason. May be servicemiz
wanted to use some api from repo and it didnt find those api, and once I
mentioned the repo location, it started using those.

I appreciate your help, that camel one would definitely be help in future.



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-in-servicemix-tp4662070p4662234.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq in servicemix

Posted by Christian Posta <ch...@gmail.com>.
I just tried this on my side with the following Camel route, everything
seemed to work just fine.
What are you seeing in the logs? When you startup servicemix can you
connect to the broker at tcp://localhost:61616 using an external JMS
client? If you run 'netstat -a | grep LISTEN' do you see the broker
listening on port 61616? I can send you my sample project that I used to
deploy the route below if that's of interest to you...


    <bean id="activeMQConnectionFactory"
          class="org.apache.activemq.ActiveMQXAConnectionFactory"
          lazy-init="false" scope="singleton">
        <property name="brokerURL" value="tcp://localhost:61616" />
    </bean>

    <bean id="jms"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="connectionFactory" ref="activeMQConnectionFactory"/>
    </bean>

    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route id="sampleJmsRoute">
            <from uri="timer:myTimer?period=5000"/>
            <transform>
                <constant>Hi</constant>
            </transform>
            <to uri="jms:outgoingQueue" />
        </route>
    </camelContext>


On Wed, Jan 23, 2013 at 7:19 AM, jainmanglesh
<ja...@rediffmail.com>wrote:

> Thank you very much for your quick reply.
> Yes I do have activemq-broker.xml file under ${servicemix_home}\etc.
>
> following are the contents of this file:
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>
> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
>            xmlns:amq="http://activemq.apache.org/schema/core">
>
>     <manifest>
>       Export-Service = javax.jms.ConnectionFactory
>     </manifest>
>
>
>     <ext:property-placeholder />
>
>     <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="default" dataDirectory="${karaf.data}/activemq/default"
> useShutdownHook="false">
>
>
>
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" producerFlowControl="true"
> memoryLimit="1mb">
>                   <pendingSubscriberPolicy>
>                     <vmCursor />
>                   </pendingSubscriberPolicy>
>                 </policyEntry>
>                 <policyEntry queue=">" producerFlowControl="true"
> memoryLimit="1mb">
>
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy>
>
>
>         <managementContext>
>             <managementContext createConnector="false"/>
>         </managementContext>
>
>
>         <persistenceAdapter>
>             <kahaDB directory="${karaf.data}/activemq/default/kahadb"/>
>         </persistenceAdapter>
>
>
>
>
>         <amq:transportConnectors>
>             <amq:transportConnector name="openwire"
> uri="tcp://localhost:61616"/>
>             <amq:transportConnector name="stomp"
> uri="stomp://localhost:61613"/>
>         </amq:transportConnectors>
>
>     </broker>
>
>     <bean id="activemqConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>
>         <property name="brokerURL" value="tcp://localhost:61616" />
>     </bean>
>
>     <bean id="pooledConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
>         <property name="maxConnections" value="8" />
>         <property name="connectionFactory" ref="activemqConnectionFactory"
> />
>     </bean>
>
>     <bean id="resourceManager"
> class="org.apache.activemq.pool.ActiveMQResourceManager"
> init-method="recoverResource">
>           <property name="transactionManager" ref="transactionManager" />
>           <property name="connectionFactory"
> ref="activemqConnectionFactory"
> />
>           <property name="resourceName" value="activemq.default" />
>     </bean>
>
>     <reference id="transactionManager"
> interface="javax.transaction.TransactionManager" />
>
>     <service ref="pooledConnectionFactory"
> interface="javax.jms.ConnectionFactory">
>         <service-properties>
>             <entry key="name" value="localhost"/>
>         </service-properties>
>     </service>
>
> </blueprint>
>
>
> I tried with both localhost and 0.0.0.0 in trasportConnector. I also tried
> with using only transportConnector (instead of amq:transportconnector).
>
> in the java code while creating connection from connectionFactory, I am
> passing following through spring injection:
>         <bean id="activeMQConnectionFactory"
> class="org.apache.activemq.ActiveMQXAConnectionFactory"
>                 lazy-init="false" scope="singleton">
>                 <property name="brokerURL" value="tcp://localhost:61616" />
>         </bean>
>
> here also I tried with both localhost and 0.0.0.0.
>
> I already have activemq on karaf(servicemix) server, as can be seen from
> following command run on server:
>
> karaf@root> list | grep activemq
> [ 285] [Active     ] [            ] [       ] [   60] activemq-ra
> (5.5.1.fuse-01-06)
> [ 286] [Active     ] [            ] [       ] [   60] activemq-core
> (5.5.1.fuse-01-06)
> [ 287] [Active     ] [Created     ] [       ] [   60] activemq-karaf
> (5.5.1.fuse-01-06)
> [ 288] [Active     ] [            ] [       ] [   60] activemq-pool
> (5.5.1.fuse-01-06)
> [ 289] [Active     ] [            ] [       ] [   60] activemq-console
> (5.5.1.fuse-01-06)
> [ 309] [Active     ] [            ] [       ] [   60] activemq-spring
> (5.5.1.fuse-01-06)
> karaf@root> features:list | grep activemq
> [installed  ] [5.5.1-fuse-01-06    ] activemq
> activemq-5.5.1-fuse-01-06
> [installed  ] [5.5.1-fuse-01-06    ] activemq-spring
> activemq-5.5.1-fuse-01-06
> [installed  ] [5.5.1-fuse-01-06    ] activemq-blueprint
> activemq-5.5.1-fuse-01-06
> [uninstalled] [5.5.1-fuse-01-06    ] activemq-web-console
> activemq-5.5.1-fuse-01-06
> [installed  ] [4.4.1-fuse-01-06    ] camel-activemq
> repo-0
> [installed  ] [4.4.1-fuse-01-06    ] activemq-broker
> repo-0
>
>
> Please let me know if more details are required. I already have spent long
> time to find this out on google however could not find anything fruitful.
>
> Help much appreciated.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/activemq-in-servicemix-tp4662070p4662077.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: activemq in servicemix

Posted by jainmanglesh <ja...@rediffmail.com>.
Thank you very much for your quick reply.
Yes I do have activemq-broker.xml file under ${servicemix_home}\etc.

following are the contents of this file:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
          
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
          
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:amq="http://activemq.apache.org/schema/core">

    <manifest>
      Export-Service = javax.jms.ConnectionFactory
    </manifest>

    
    <ext:property-placeholder />

    <broker xmlns="http://activemq.apache.org/schema/core"
brokerName="default" dataDirectory="${karaf.data}/activemq/default"
useShutdownHook="false">

       
              
        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" producerFlowControl="true"
memoryLimit="1mb">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                </policyEntry>
                <policyEntry queue=">" producerFlowControl="true"
memoryLimit="1mb">
                  
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy> 

        
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        
        <persistenceAdapter>
            <kahaDB directory="${karaf.data}/activemq/default/kahadb"/>
        </persistenceAdapter>

       

        
        <amq:transportConnectors>
            <amq:transportConnector name="openwire"
uri="tcp://localhost:61616"/>
            <amq:transportConnector name="stomp"
uri="stomp://localhost:61613"/>
        </amq:transportConnectors>

    </broker>

    <bean id="activemqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">

        <property name="brokerURL" value="tcp://localhost:61616" />
    </bean>

    <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
        <property name="maxConnections" value="8" />
        <property name="connectionFactory" ref="activemqConnectionFactory"
/>
    </bean>

    <bean id="resourceManager"
class="org.apache.activemq.pool.ActiveMQResourceManager"
init-method="recoverResource">
          <property name="transactionManager" ref="transactionManager" />
          <property name="connectionFactory" ref="activemqConnectionFactory"
/>
          <property name="resourceName" value="activemq.default" />
    </bean>

    <reference id="transactionManager"
interface="javax.transaction.TransactionManager" />

    <service ref="pooledConnectionFactory"
interface="javax.jms.ConnectionFactory">
        <service-properties>
            <entry key="name" value="localhost"/>
        </service-properties>
    </service>

</blueprint>


I tried with both localhost and 0.0.0.0 in trasportConnector. I also tried
with using only transportConnector (instead of amq:transportconnector).

in the java code while creating connection from connectionFactory, I am
passing following through spring injection:
	<bean id="activeMQConnectionFactory"
class="org.apache.activemq.ActiveMQXAConnectionFactory"
		lazy-init="false" scope="singleton">
		<property name="brokerURL" value="tcp://localhost:61616" />
	</bean>

here also I tried with both localhost and 0.0.0.0.

I already have activemq on karaf(servicemix) server, as can be seen from
following command run on server:

karaf@root> list | grep activemq
[ 285] [Active     ] [            ] [       ] [   60] activemq-ra
(5.5.1.fuse-01-06)
[ 286] [Active     ] [            ] [       ] [   60] activemq-core
(5.5.1.fuse-01-06)
[ 287] [Active     ] [Created     ] [       ] [   60] activemq-karaf
(5.5.1.fuse-01-06)
[ 288] [Active     ] [            ] [       ] [   60] activemq-pool
(5.5.1.fuse-01-06)
[ 289] [Active     ] [            ] [       ] [   60] activemq-console
(5.5.1.fuse-01-06)
[ 309] [Active     ] [            ] [       ] [   60] activemq-spring
(5.5.1.fuse-01-06)
karaf@root> features:list | grep activemq
[installed  ] [5.5.1-fuse-01-06    ] activemq                            
activemq-5.5.1-fuse-01-06
[installed  ] [5.5.1-fuse-01-06    ] activemq-spring                     
activemq-5.5.1-fuse-01-06
[installed  ] [5.5.1-fuse-01-06    ] activemq-blueprint                  
activemq-5.5.1-fuse-01-06
[uninstalled] [5.5.1-fuse-01-06    ] activemq-web-console                
activemq-5.5.1-fuse-01-06
[installed  ] [4.4.1-fuse-01-06    ] camel-activemq                      
repo-0
[installed  ] [4.4.1-fuse-01-06    ] activemq-broker                     
repo-0


Please let me know if more details are required. I already have spent long
time to find this out on google however could not find anything fruitful.

Help much appreciated.



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-in-servicemix-tp4662070p4662077.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq in servicemix

Posted by Christian Posta <ch...@gmail.com>.
by default, i believe there should be an activemq-broker.xml file in the
etc folder of the servicemix installation. do you have that?


On Wed, Jan 23, 2013 at 5:44 AM, jainmanglesh
<ja...@rediffmail.com>wrote:

> Hi,
> I have a bundle with my implementation of managing messaging with activemq
> queue. I want to deploy this bundle on servicemix however I dont know the
> broker URL which I should use. when I deployed this on standalone activemq
> server I used following URL for brokerURL: tcp://localhost:61616.
>
> However this does not seem to work (or I think I might me missing some
> config to tell servicemix to use this url as activemq broker URL).
>
> I can see activemq as installed when i run features:list command on
> servicemix.
>
> Can anyone please help me in finding how/what broker URL I should use to
> correctly deploy my application on servicemix.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/activemq-in-servicemix-tp4662070.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta