> I'm perfectly happy to update this to the Artemis configuration file
method instead

You'd replace:

  BrokerFactory.createBroker()

With something like:

  new EmbeddedActiveMQ();

This assumes there's a valid broker.xml configuration on your classpath. If
your broker.xml isn't on the classpath then you can specify a URL for it,
e.g.:

  new EmbeddedActiveMQ("file:///path/to/broker.xml");

Your broker.xml can define all the resources (addresses, queues, etc.) you
plan on using.

> If I understand correctly, I need to replace the references to
activemq-broker-initializer...

I'm not familiar with this activemq-broker-initializer so I can't address
this point specifically.

> Next, I need to use ConnectionFactory and Queue classes from JMS to add
the message queues to the embedded server I created with EmbeddedActiveMQ.
Is that at least heading in the right direction?

You _can_ use JMS. Or you can use a client implementation for any other
protocol the broker supports (i.e. AMQP, STOMP, MQTT).


Justin

On Fri, Jan 6, 2023 at 1:50 PM Michael Brennock <mbrenn...@gmail.com> wrote:

> Thank you for your feedback Justin. I will be more specific in my
> descriptions.
>
>
>    - First, the activeMQ application creates an instance of BrokerService
>    from BrokerFactory.createBroker(), with a activemq-config.xml for its
>    argument
>    - Next, the queues themselves are loaded one at a time by locating their
>    beans. The beans are wired in the classic spring fashion from
>    eps.broker.xml. The connected are created with ConnectionFactory and
>    started with start()
>       - (I'm perfectly happy to update this to the Artemis configuration
>       file method instead)
>
> If I understand correctly, I need to replace the references to
> activemq-broker-initializer with EmbeddedActiveMQ, which comes from
> Artemis. Next, I need to use ConnectionFactory and Queue classes from JMS
> to add the message queues to the embedded server I created with
> EmbeddedActiveMQ. Is that at least heading in the right direction?
>
> Thanks again for your help,
>
> Michael
>
> On Fri, Jan 6, 2023 at 11:16 AM Justin Bertram <jbert...@apache.org>
> wrote:
>
> > There's just not enough detail in what you've stated to provide any
> > concrete help with your migration.
> >
> > You said, "...it looks like BrokerService is used throughout the
> > application," but you've provided no details about _how_ BrokerService is
> > used. Most applications using an embedded broker are pretty
> straightforward
> > when it comes to broker configuration. They typically create a broker
> > instance, configure it with a few endpoints (e.g. queues, topics, etc.),
> > configure a couple of other parameters, start it, use it, and when the
> > application is done it shuts the broker down. Does your application
> follow
> > this basic pattern? Does it configure the broker programmatically or does
> > it load configuration files? Does it rely on automatic creation of
> > endpoints?
> >
> > In order to replace BrokerService with EmbeddedActiveMQ we need specific
> > details about how BrokerService is being used.
> >
> > Hope that helps!
> >
> >
> > Justin
> >
> > On Fri, Jan 6, 2023 at 12:21 PM Michael Brennock <mbrenn...@gmail.com>
> > wrote:
> >
> > > Thanks for the quick reply!
> > >
> > > For a more specific question, it looks like BrokerService is used
> > > throughout the application, as well as the active-mq-initializer bean
> > from
> > > activeMQ.
> > > To clarify, I inherited this project from other developers who are long
> > > gone. I started working on this because I briefly worked on a message
> > queue
> > > system before.
> > >
> > > On Thu, Jan 5, 2023, 8:41 PM Justin Bertram <jbert...@apache.org>
> wrote:
> > >
> > > > EmbeddedActiveMQ is the class you want to use for embedding ActiveMQ
> > > > Artemis. The BrokerService is a class from ActiveMQ "Classic". It is
> > used
> > > > in the ActiveMQ Artemis code-base only for testing purposes. You
> won't
> > > use
> > > > it at all when migrating.
> > > >
> > > > For additional help you'll have to ask more specific questions.
> > > >
> > > >
> > > > Justin
> > > >
> > > > On Thu, Jan 5, 2023 at 4:45 PM Michael Brennock <mbrenn...@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Good afternoon,
> > > > > I've been tasked to migrate an existing application's message
> broker
> > > from
> > > > > ActiveMQ to Artemis. I was wondering if I could get some help
> > > > > troubleshooting my solution?
> > > > >
> > > > > We had some initial success replacing our embedded activeMQ broker
> > > with a
> > > > > standalone broker that runs outside the application and still uses
> > the
> > > > > original message queues defined in activeMQ. I tried to follow the
> > > > > information in this guide for creating either an EmbeddedActiveMQ
> or
> > a
> > > > > BrokerService. Something about the intended design path is unclear
> to
> > > me,
> > > > > even after reading the manual (1) and scouring the code from the
> > github
> > > > > page for answers (2)
> > > > >
> > > > > Can anyone offer advice on how to migrate from embedded ActiveMQ to
> > > > > embedded Artemis? I feel like I missed something important in the
> > > > migration
> > > > > documentation
> > > > >
> > > > > (1)
> > > > >
> > > > >
> > > >
> > >
> >
> https://activemq.apache.org/components/artemis/documentation/latest/embedding-activemq.html
> > > > >
> > > > >
> > > > > (2)
> > https://github.com/apache/activemq-artemis/search?q=brokerService
> > > > >
> > > >
> > >
> >
>

Reply via email to