How to add dynamic destinations to camel? - apache-camel

I am new to Apache Camel. I am trying to build a pubsub pattern with Camel. I want to add subscribers dynamically so that a single event can be received by dynamic number of receivers. How can I do that? Thanks.

You can for example use JMS for that. I am its a bit cheap answer. But pub-sub is native supported by JMS.

Related

using reactive-streams with Apache Camel Saga

I would like to know if it is possible to use reactive streams in Apache Camel. I know reactive-streams is a component from Apache but I couldn't get it to work the way they explain in the documentation. I would like to know if there is any possible solutions available in github that could help me understand apache camel along with reactive-streams except the one's from apache.
I could possibly use Producer Template with reactor-core but the route logic that sits in RouteBuilder configure method would still be blocking I/O. Any helps would be appreciated?

Camel-Jetty HTTP/2 support

I've seen that Jetty now supports HTTP/2. Spent some time researching and can't see a way of implementing this in Apache Camel-Jetty. Any idea whether this is something that Camel will need to implement? Or is it configurable using their RestConfigurationDefinition?
Thanks in advance.
I'm afraid you need to do some extra work to enable the HTTP/2 feature. Camel-Jetty Components has two parts, one is Consumer (Jetty Server) and the other is Producer (Jetty Client). If you want to enable the HTTP/2 feature, you need to make sure the Http module is loaded by modifying some code. I don't think you can do it by doing some configuration with the RestConfigurationDefinition.
Please send a feature request by creating a JIRA for it.

jms expiration, AMQ->MQ Series

We are trying to preserve TimeToLive/JMSExpiration in our messages during moving them from AMQ queue to IBM MQ Series queue, currently we use: jmsBridgeConnectors in AMQ to move the messages but the expiration is not preserved.
I know that AMQ suggests to rather use Camel instead of jmsBridgeConnectors to bridge AMQ to external messaging systems, but I have no experience with Camel.
Did anyone face similar issue and have some working solution, either with jmsBridgeConnectors or Camel?
Many thanks in advance
Best Regards
Lukasz
If you use Camel and its JMS component, then you can turn on preserveMessageQos which will then transfer the expiration detail. See more details in the Camel documentation (see the table of the option): http://camel.apache.org/jms
In terms of the JMS bridge, I assume you refer to the AMQ JMS bridge? http://activemq.apache.org/jms-to-jms-bridge.html - I am not sure if you can configure to keep the expiration or not. Others here at SO may know, or you can dive into the source code, or try to ask on the ActiveMQ user mailing list.

Can I use Camel and WMQ without JMS?

I am currently learning Camel, and have a specific project in mind that requires a Websphere MQ back-end, but I can't use JMS components, since I need a lot of non-jms headers, like MQIIH.
I found the camel-wmq project.
Is it the recommended solution ? Is it any good ?
You don't need to use jms. WMQ has a client API. Just download the wmq client jars and put them in your project and use them together with your Camel routes. You will probably put the wmq client code in a processor class or something similar. Off course best to test to put a message on a queue manually via RFHUTIL or something similar as a client so you are sure the environment setup is correct.
The suggested way of working with WMQ has always been through the JMS component since it enables you to painlessly switch to other providers if the need arises.
However, if you need to use some WMQ-specific function then my suggestion would be to extend the camel-wmq library - it contains only a subset of features supported by WMQ and does not support MQIIH headers that you need. Adding functionality to a component would probably involve more work than the solution Souciance Eqdam Rashti suggested but it would be a cleaner solution and more in line with Camel's philosophy. Also, you'd be giving back to the community and thus help make Camel a better tool for everyone :)
I would also suggest you go through the IBM MQ discussions on the Camel's official user group mailing list and see if you can salvage anything.

Difference between processor , component and end point

I am studying Apache Camel.
Could some one please explain the difference between a processor, component and endpoint with regard to Apache Camel.
A component allows you to talk with other systems. It allows you to send or receive messages and encapsulates the protocol to deal with another system. For e.g. jms-component allows to talk with JMS brokers.
An endpoint is nothing but the channel by which you send or receive a message through component e.g. "jms:queue:order" this defines a jms endpoint which is a queue from where your (jms) component will either consume or publish a message.
While a processor is piece of code which goes in between routes. There you write code to manipulate (transform/enrich/extract etc.) the message or have some integration logic.
For more details refer to camel's documentation
All whom are new to Apache Camel I suggest to read this article which explains really well what Camel is, and has an example to go along.
http://java.dzone.com/articles/open-source-integration-apache
Another great piece is chatper 1 of the Camel in Action book, which can be freely downloaded from here: http://www.manning.com/ibsen/Camel_ch01_update.pdf
Disclaimer: I am co-author of that book.
And there is this old by good tutorial that still applies today: http://camel.apache.org/tutorial-example-reportincident.html
And you can find more tutorials / examples on the Camel website
http://camel.apache.org/tutorials.html
http://camel.apache.org/examples.html
And there is also some links to 3rd party blogs/articles/videos about Camel, where you can find some great information:
http://camel.apache.org/articles.html

Resources