activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Message properties with a period in them?
Date Tue, 29 Jan 2008 02:41:50 GMT
On 29/01/2008, robomon <r_ford@pacbell.net> wrote:
> I now have a home brewed orion-activemq bridge that re-publishes messages
> from either JMS system and switches the property names to "." for orion
> publishes or "_" for activemq publishes.  This will get me by until we can
> gradually migrate fully to ActiveMQ.
>
> This conversion of messages didn't work before when I posted this.  The only
> thing I can think of that I changed that might have helped was a classpath
> entry.  I had both geronimo-j2ee-management_1.0_spec-1.0.jar and
> geronimo-j2ee-management_1.0_spec-1.1.jar in the classpath (and I can't
> remember which one was first).  I am now using the
> geronimo-j2ee-management_1.0_spec-1.0.jar only.  I may try playing with this
> when I have time and see if  I can reproduce the problem by switching the
> classpath again.
>
> I hope to next build this JMS Bridge using ServiceMix and a JBI instead of
> this client style dual consumer/publisher I have now.  That all depends on
> time though.

You might wanna look at writing a quick Camel transformation using a
method call. Then you could do something like...

from("orion:someQueue").
 process(DotToUnderlineHeaderTransformer.class).
 to("activemq:anotherQueue");

Where DotToUnderlineHeaderTransformer looks like

public class DotToUnderlineHeaderTransformer implements Processor {
  public void process(Exchange exchange) {
     Message out = exchange.getOut(true);
     out.setBody(exchange.getIn().getBody());

     // iterate through in.getHeaders() and replace dots with underlines...
  }
}


Then you'll be able to include the Orion <-> ActiveMQ bridge in the
ActiveMQ broker - or use it in ServiceMix in a JBI environment (or via
the servicemix-camel JBI component in another JBI container).

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message