You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sebge2 <se...@cyberplongeurs.be> on 2010/04/16 12:32:21 UTC

Embedded ActiveMQ configuration

Hello,

In order to test my application (maven test), I need an embedded activeMQ
instance. I've seen that there is two ways of declaring my broker. First, by
defining a BrokerService bean and directly configuring it. In the attached
file, you can see my spring bean.
http://old.nabble.com/file/p28265327/messaging-embedded-bean-activemq-strategy.xml
messaging-embedded-bean-activemq-strategy.xml 

The other way described in the documentation is to do:
    <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
        <property name="config"
value="classpath:META-INF/sf-test/bootstrap/embedded-activemq/activemq.xml"/>
        <property name="start" value="true"/>
    </bean>

With the traditional configuration file (I've removed jetty, and camel
routes):
http://old.nabble.com/file/p28265327/activemq.xml activemq.xml 


My problem is that with an embedded instance, my DLQ policy is not applied.
So, poison messages are placed in ActiveMQ.DLQ instead of DLQ.<myQueue>. In
a standalone activeMQ this works as expected. Is there something to
configure to custom the default DLQ policy ?


Thanks for your help :)

Sébastien


-- 
View this message in context: http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28265327.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Embedded ActiveMQ configuration

Posted by sebge2 <se...@cyberplongeurs.be>.
What's the dependencies of the retrying policy ? I'm only declaring the
broker service bean, must it work like that or further configuration is
needed ? I've put in attachment my current configuration of my broker. Have
I missed something ? http://old.nabble.com/file/p28367104/brokerService.txt
brokerService.txt 


PS: thanks for your previous replies, in fact my connection factory was
creating its own broker so, the broker I've declared in my spring file was
not the right one, but the problem remains.




-- 
View this message in context: http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28367104.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Embedded ActiveMQ configuration

Posted by Gary Tully <ga...@gmail.com>.
start by doing a diff between both config files, the policy entries should
be the same in both and they are not. it looks correct in the non embedded
version.

On 16 April 2010 13:30, sebge2 <se...@cyberplongeurs.be> wrote:

>
> what are the beans you are talking about ? I've check that only one
> instance
> is running.
>
> In the following log, the execution of my broker:
> http://old.nabble.com/file/p28266311/activemq.log activemq.log . In that
> log
> we can see that the message is finally redirected to queue://ActiveMQ.DLQ,
> and not: queue://DLQ.com.bsb.sf.incubator.jms.queueA
>
> I've also changed the url (vm://broker?create=false&waitForStart=5000), the
> situation is the same.
>
>
>
> Gary Tully wrote:
> >
> > Ensure that you are not creating two brokers. Check the log output.
> > Order of initialisation of your beans is important, you may want to
> > declare
> > some dependencies or you can explicity disable embedded broker creation
> in
> > the vm url used by your connection factory with:
> >  vm://broker?create=false&waitForStart=5000
> >
> > see: http://activemq.apache.org/vm-transport-reference.html in
> particular
> > the note at the end.
> >
> > On 16 April 2010 11:32, sebge2 <se...@cyberplongeurs.be>
> wrote:
> >
> >>
> >> Hello,
> >>
> >> In order to test my application (maven test), I need an embedded
> activeMQ
> >> instance. I've seen that there is two ways of declaring my broker.
> First,
> >> by
> >> defining a BrokerService bean and directly configuring it. In the
> >> attached
> >> file, you can see my spring bean.
> >>
> >>
> http://old.nabble.com/file/p28265327/messaging-embedded-bean-activemq-strategy.xml
> >> messaging-embedded-bean-activemq-strategy.xml
> >>
> >> The other way described in the documentation is to do:
> >>    <bean id="broker"
> class="org.apache.activemq.xbean.BrokerFactoryBean">
> >>        <property name="config"
> >>
> >>
> value="classpath:META-INF/sf-test/bootstrap/embedded-activemq/activemq.xml"/>
> >>        <property name="start" value="true"/>
> >>    </bean>
> >>
> >> With the traditional configuration file (I've removed jetty, and camel
> >> routes):
> >> http://old.nabble.com/file/p28265327/activemq.xml activemq.xml
> >>
> >>
> >> My problem is that with an embedded instance, my DLQ policy is not
> >> applied.
> >> So, poison messages are placed in ActiveMQ.DLQ instead of DLQ.<myQueue>.
> >> In
> >> a standalone activeMQ this works as expected. Is there something to
> >> configure to custom the default DLQ policy ?
> >>
> >>
> >> Thanks for your help :)
> >>
> >> Sébastien
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28265327.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source Integration
> > http://fusesource.com
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28266311.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Embedded ActiveMQ configuration

Posted by sebge2 <se...@cyberplongeurs.be>.
what are the beans you are talking about ? I've check that only one instance
is running. 

In the following log, the execution of my broker: 
http://old.nabble.com/file/p28266311/activemq.log activemq.log . In that log
we can see that the message is finally redirected to queue://ActiveMQ.DLQ,
and not: queue://DLQ.com.bsb.sf.incubator.jms.queueA

I've also changed the url (vm://broker?create=false&waitForStart=5000), the
situation is the same.



Gary Tully wrote:
> 
> Ensure that you are not creating two brokers. Check the log output.
> Order of initialisation of your beans is important, you may want to
> declare
> some dependencies or you can explicity disable embedded broker creation in
> the vm url used by your connection factory with:
>  vm://broker?create=false&waitForStart=5000
> 
> see: http://activemq.apache.org/vm-transport-reference.html in particular
> the note at the end.
> 
> On 16 April 2010 11:32, sebge2 <se...@cyberplongeurs.be> wrote:
> 
>>
>> Hello,
>>
>> In order to test my application (maven test), I need an embedded activeMQ
>> instance. I've seen that there is two ways of declaring my broker. First,
>> by
>> defining a BrokerService bean and directly configuring it. In the
>> attached
>> file, you can see my spring bean.
>>
>> http://old.nabble.com/file/p28265327/messaging-embedded-bean-activemq-strategy.xml
>> messaging-embedded-bean-activemq-strategy.xml
>>
>> The other way described in the documentation is to do:
>>    <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
>>        <property name="config"
>>
>> value="classpath:META-INF/sf-test/bootstrap/embedded-activemq/activemq.xml"/>
>>        <property name="start" value="true"/>
>>    </bean>
>>
>> With the traditional configuration file (I've removed jetty, and camel
>> routes):
>> http://old.nabble.com/file/p28265327/activemq.xml activemq.xml
>>
>>
>> My problem is that with an embedded instance, my DLQ policy is not
>> applied.
>> So, poison messages are placed in ActiveMQ.DLQ instead of DLQ.<myQueue>.
>> In
>> a standalone activeMQ this works as expected. Is there something to
>> configure to custom the default DLQ policy ?
>>
>>
>> Thanks for your help :)
>>
>> Sébastien
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28265327.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28266311.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Embedded ActiveMQ configuration

Posted by Gary Tully <ga...@gmail.com>.
Ensure that you are not creating two brokers. Check the log output.
Order of initialisation of your beans is important, you may want to declare
some dependencies or you can explicity disable embedded broker creation in
the vm url used by your connection factory with:
 vm://broker?create=false&waitForStart=5000

see: http://activemq.apache.org/vm-transport-reference.html in particular
the note at the end.

On 16 April 2010 11:32, sebge2 <se...@cyberplongeurs.be> wrote:

>
> Hello,
>
> In order to test my application (maven test), I need an embedded activeMQ
> instance. I've seen that there is two ways of declaring my broker. First,
> by
> defining a BrokerService bean and directly configuring it. In the attached
> file, you can see my spring bean.
>
> http://old.nabble.com/file/p28265327/messaging-embedded-bean-activemq-strategy.xml
> messaging-embedded-bean-activemq-strategy.xml
>
> The other way described in the documentation is to do:
>    <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
>        <property name="config"
>
> value="classpath:META-INF/sf-test/bootstrap/embedded-activemq/activemq.xml"/>
>        <property name="start" value="true"/>
>    </bean>
>
> With the traditional configuration file (I've removed jetty, and camel
> routes):
> http://old.nabble.com/file/p28265327/activemq.xml activemq.xml
>
>
> My problem is that with an embedded instance, my DLQ policy is not applied.
> So, poison messages are placed in ActiveMQ.DLQ instead of DLQ.<myQueue>. In
> a standalone activeMQ this works as expected. Is there something to
> configure to custom the default DLQ policy ?
>
>
> Thanks for your help :)
>
> Sébastien
>
>
> --
> View this message in context:
> http://old.nabble.com/Embedded-ActiveMQ-configuration-tp28265327p28265327.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com