camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <hekon...@gmail.com>
Subject Re: Custom endpoint configuration and Spring Boot
Date Fri, 25 Sep 2015 12:18:46 GMT
Hi Jimmy,

If you would like to create a simple URI for the pre-configured component,
then Claus suggestion to create a Spring bean with name/alias matching your
target component, is a way to go. Register the pre-configured JMS component
via:

@Bean(name = "wmq")
JmsComponent myWmqComponent() {
  JmsComponent  jmsComponent = new JmsComponent();

  jmsComponent.setDestinationResolver(new MQDestinationResolver());

  return jmsComponent;
}


Then use the "wmq" bean name in the endpoint URI:


  from("wmq:myQueue").to(...);


Cheers!




pt., 25.09.2015 o 13:42 użytkownik Jimmy Selgen Nielsen <
jimmy.selgen@gmail.com> napisał:

>
> > On 25. sep. 2015, at 12.00, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> >
> > Maybe an earlier callback can be added to CamelContextConfiguration?
> >
> > But instead of using that callback you can use some spring annotation
> > that creates this component and name it wmq. Then Camel lookup in the
> > spring bean registry for "wmq" when it wants to use the component with
> > that name, and uses your bean.
> >
>
> For now i’m using a workaround by routing my deadLetterChannel to a
> “direct:deadLetter” route, which then routes the message to the real
> deadLetter queue:
>
> from(directBackoutQueue)
> .wireTap("log:"+"dk.bec"+"?level=WARN&showAll=true")
> .to(backoutQueue);
>
> and then in my main route:
>
> from(…..)
> .errorHandler(deadLetterChannel(directBackoutQueue).maximumRedeliveries(0))
>
> I’m not sure if the deadLetterChannel resolving endpoints at route
> configuration time is intentional - it makes sense that a deadLetterChannel
> must exist - but it seems kinda pointless if it is that easily defeated.
>
> As for the earlier callback in CamelContextConfiguration, this seems like
> the correct solution.
>
> /J

-- 
Henryk Konsek
http://about.me/hekonsek

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message