If I read it correctly, the transformer together with the divert provides a
means to duplicate messages from any number of inbound destinations to a
parallel set of destinations by adding a prefix.

For example:

test.events.a.1  -> TestQ.test.events.a.1

test.events.b.2 -> TestQ.test.events.b.2

Like a wiretap, using parallel queue structures.

Did I get that right?

Art


On Thu, Jun 6, 2024 at 8:55 AM Justin Bertram <jbert...@apache.org> wrote:

> Generally speaking, _every_ commit which fixes a bug or adds a feature or
> improvement should have a test. This ensures the bug is actually fixed or
> the feature actually works and also mitigates regressions later.
>
> Furthermore, if you want this to be something accessible to end-users then
> documentation should be part of the commit as well (e.g. here [1]).
>
> All that said, however, I'm not sure the use-case for this transformer is
> general enough to be shipped with the broker. I can't really tell what the
> use-case is based on your email.
>
> Of course, feel free to send a PR with tests and documentation and then it
> can be properly evaluated.
>
>
> Justin
>
> [1]
>
> https://github.com/apache/activemq-artemis/blob/main/docs/user-manual/transformers.adoc
>
> On Thu, Jun 6, 2024 at 7:24 AM <maximilian.rie...@systema.com> wrote:
>
> > Hello,
> >
> > we are currently using a Transformer to redirect Event messages into a
> > queue to consume them as kind of Unique Processing by distributed
> > applications.
> > For this we use a transformer:
> >
> > public class PrefixAddressTransformer implements Transformer
> > {
> >    @Override
> >    public Message transform(Message message)
> >    {
> >       SimpleString originalAddress =
> >
> (SimpleString)message.getBrokerProperty(Message.HDR_ORIGINAL_ADDRESS);
> >       message.setAddress(message.getAddress() + "."
> > +originalAddress.toString());
> >       return message;
> >    }
> > }
> >
> > That we use with with a divert:
> >
> >       <diverts>
> >          <divert name="test-events-divert">
> >               <address>test.events.#</address>
> >               <forwarding-address>TestQ</forwarding-address>
> >               <exclusive>true</exclusive>
> >
> >
> <transformer-class-name>org.apache.activemq.artemis.core.server.transformer.PrefixAddressTransformer</transformer-class-name>
> >          </divert>
> >      </diverts>
> >
> > So that all messages on test.events.# are also sent to a queue
> > TestQ.test.events... and can be processed in a distributed manner.
> > Others might also profit from this, so we wanted to commit it to the
> > offical artemis repo.
> >
> > Should there be testing done on this transformer, like with the
> >
> org.apache.activemq.artemis.core.server.transformer.AddHeadersTransformer,
> > which is tested in
> >
> org.apache.activemq.artemis.tests.integration.management.DivertControlTest
> > ?
> >
> > best regards
> > Maximilian Rieder
> > ------------------------------
> >
> > *Maximilian Rieder*
> > Software Engineer
> >
> > Phone: +49 941 / 7 83 92 84
> > maximilian.rie...@systema.com
> >
> > www.systema.com
> >
> > [image: LinkedIn] <https://www.linkedin.com/company/systema-gmbh/
> >[image:
> > Facebook] <https://de-de.facebook.com/SYSTEMA.automation/>[image: XING]
> > <https://www.xing.com/pages/systemagmbh>
> >
> > SYSTEMA
> > Systementwicklung Dipl.-Inf. Manfred Austen GmbH
> >
> > Manfred-von-Ardenne-Ring 6 | 01099 Dresden
> > HRB 11256 Amtsgericht Dresden | USt.-ID DE 159 607 786
> > Geschäftsführer: Manfred Austen, CEO und Dr. Ulf Martin, COO
> >
> > P Please check whether a printout of this e-mail is really necessary.
> >
>

Reply via email to