Posts

Showing posts from 2011

Getting Started with Apache Camel (Video)

Image
In this video demonstration, published on the FuseSource YouTube channel, you're going to see how to get started with Apache Camel (FUSE Mediation Router) on a real world scenario working with a Composed Enterprise Integration Pattern (FUSE EIP).
The video demonstration talks about a Book Shop example application that receives a message from a JMS source, in this case Apache ActiveMQ / FUSE Message Broker and then split the message according to number of orders available in the message, then based on the content the message is going to be routed to different web services endpoints (provided by Apache CXF / FUSE Services Framework), after that the requests to the web services are then aggregated through the Apache Camel aggregator component and finally the resulting message is sent to a response JMS queue.

Enjoy the ride...

Virtual and Composite Destinations with Apache ActiveMQ

Image
Apache ActiveMQ / FUSE Message Broker has a feature called Virtual Destinations that are logical destinations (queues or topics) mapped to one or more physical destinations.

There are many benefits for using Virtual Destinations with ActiveMQ but basically you can forward messages from one JMS destination to many destinations (mixing queues and topics if you want), route messages to target destinations based on message headers (a.k.a broker-based message routing) and create highly-available load-balanced durable subscribers.



As an example, looking in the diagram above, you can have a Virtual Destination called q1, where applications will send messages to as they do to any other regular queue, and then the message will get propagated to a real physical queue called q1, to a real queue physical queue called Q2 and also to a topic called T1.

The example above is called Composite Destinations and the idea behind it is to map a Virtual Destinations to a hard-wired collection of physical de…

Load-balanced Ordered Message Processing with Apache ActiveMQ

Image
On my previous post (Preserving Message Order with Apache ActiveMQ) we took a look on what would be necessary to preserve message order using Apache ActiveMQ (FUSE Message Broker). We then explored on the ActiveMQ capabilities called Exclusive Consumers.
But, Exclusive Consumers bring one disadvantage that is having active consumers not doing anything (actually not consuming messages) and that may be not the desired behavior. So, let's take a look on how ActiveMQ (FUSE Message Broker) can help to avoid that situation and explore what capabilities and/or techniques are available to process messages in order when multiple consumers are active.
ActiveMQ has a feature called Message Groups which is the way to load balance multiple active consumers listening to the same queue while preserving message order. ActiveMQ will then group messages on the queue and it will guarantee that all messages of a particular group arrive in order on the same consumer.
So, to give you an example, let&#…

Preserving Message Order with Apache ActiveMQ

Image
There are some use cases and business scenarios where you have to process messages in order. Basically, when multiple consumers receive messages from a queue and process them in parallel, message order is not preserved.

Apache ActiveMQ has the capability to process messages in order using a feature called Exclusive Consumers. With Exclusive Consumers all messages from a single queue are processed by only one consumer (other consumers listening on the same queue will take over if the exclusive consumer fails).

So, fundamentally the diagram below shows how Exclusive Consumers work where Consumer A and Consumer B are both listening to the same queue but only the Consumer A is consuming messages from it.





The Exclusive Consumer feature is configured at the consumer level, so at the code level you have to explicitly say what queue you're listening in and also say you're an an exclusive consumer.

Here is a piece of code showing how to set the Exclusive Consumer:


queue = new ActiveMQQueue(…

We're hiring!

Do you have a technical background and also love the exciting sales world?

Do you like to be in front of the customers discussing technical architecture, new business opportunities and helping them solving the most complex integration problems?

Are you based in Europe (preferably in London)?

Do you want to work for a fast growing company in the open source integration and messaging business?

Well, the time has arrived… FuseSource is looking for a Solutions Engineer to join our team and be part of a very strategic group within the company.

The detailed job description is here: http://fusesource.com/careers/#SE but you can also contact me if you want to talk about it :)

Let's enjoy the ride together...

LinkedIn Veterans Hackday 2011

A little different topic today but for a really good cause. I really appreciate all the effort that the military personnel has been putting together and I have heard many stories from a few and also some scary ones from the war zone which is not fun at all. That's the reality of the world we live in and while we can't (yet) stop the war, we can improve the life of the ones being part of that.

Today, I found that LinkedIn is promoting a Veterans Hackday and honestly there is nothing better than being able to use your skills to give something back to those that sacrifices their lives every day.

So, I decided to use my tech skills and hack a little project that will benefit our veterans. I honestly can't do all of that by myself and I'm counting on those from the San Diego, CA area that are available and want to work together on this over the weekend.

As I just started organizing this, I don't have an idea yet but I'd be glad to start designing something as soon a…

JMS and Database Integration with Apache ServiceMix, Camel and ActiveMQ

I've been asked to create a simple project to demonstrate how Apache ActiveMQ, Camel and ServiceMix could be used in the same integration context. Then, for the specific customer I was talking to, I decided to create something related to the world they were used to.

This example will process messages as they are delivered on an input queue and I thought that XML would be a good format to also demonstrate how to parse the payload and generate an SQL statement  before hitting the database.

In summary, for each message going to the input queue, we're going to create a record in the database table and then generate a response message on the output queue.

I'm assuming you're already have Apache ServiceMix downloaded and installed in your machine. If not, it's time to download it… I recommend you to just go to http://fusesource.com/downloads/ and download FUSE ESB.

I'm also assuming that you already have Maven installed but if not feel free to download and install it…

Using Apache Camel for Application Notification

I was watching a forum thread (http://fusesource.com/forums/thread.jspa?threadID=3433) this week where the use case was not to consume the file content but rather the file name. That seems to be an interesting use of Apache Camel because most of people used the Camel File Component to consume the contents of the file and then do some kind of processing on top of that (routing, web services invocation, ftp, bean execution, database interaction, etc).

What brought my attention to this specific use case is that the important information here was the file name and not the content of the file. Given that the file itself was pretty large (around ~1GB) it would be a nightmare to handle all of that in memory on a Camel route or any other middleware available out there. But, this use case is really about notifying other systems or applications that a large file is available to be processed outside the route (think about a file being available for download for example) and the reason to only ca…

FuseSource Community Day in San Francisco, CA - November 17th

Thirsty for information about Apache Camel? Hungry to learn more about Apache ActiveMQ in production environments? Keen to know more about the Business Impact of Open Source Software...

Don't miss the opportunity to hear from Rob Davies (CTO of FuseSource, PMC Member, Founder and Committer on Apache ServiceMix and ActiveMQ and also the co-author of ActiveMQ in Action) and James Strachan (Creator of Groovy, member of the Apache Software Foundation and co-founder of Apache Camel). You'll be also hearing from architects, consultants and developers using those technologies in real world applications and what problems they were able to solve.

Not enough for you?!?! The FuseSource Community Day will be held at a really nice venue in downtown San Francisco called Thirsty Bear (661 Howard St., San Francisco, CA 94103).

For more information, visit the event web page: http://form.fusesource.com/sanfrancisco2011

I hope to see you all there...


Using HTTP-based endpoints with Apache Camel

Image
On a recent discussion, a partner was trying to use Apache ActiveMQ HTTP Transport Connectors to receive HTTP requests from a non-JMS Web application and asked me what I would think it could be a good approach to the use-case. Analyzing the use case, which needs a synchronous multi-step execution I suggested that they took a look in the Apache Camel Jetty component instead of Apache ActiveMQ and that was surprisingly easier to setup and maintain then the original approach.


While there is nothing wrong with the approach they thought about I think that Apache Camel would give them a more powerful setup to what they were looking for.


So, here is a sample configuration, that I created as a demo project, using Apache Camel Jetty component enabling HTTP endpoints.


In our Apache Camel route definition (using the Spring XML approach in this case) we'll have to define the Jetty endpoint similar to this:


<routeid="Jetty_Sample"> <fromuri="jetty:http://localhost:8888/myBoo…

FuseSource Training in Brazil

Since the FuseSource Brazilian tour a couple of weeks ago I've been getting more and more questions about what's next for the region. Well, here is the next step... We're going to deliver an Apache ActiveMQ training class on Nov, 16-17 in São Paulo and an Apache ServiceMix with Camel training class on November, 18-19 also in São Paulo. We are still working to get a nice venue for the training in case you wonder where this is going to happen.

I've personally been involved in the FuseSource training and I can guarantee you that's a lot of fun and tons of good information.

Here is the URL with information about the training classes: http://fusesource.com/enterprise-support/open-enrollment/ but if you have any questions please don't hesitate to contact me through this blog, Twitter (@mjabali) or e-mail (marcelo@fusesource.com).

Hope to see you there...

Apache ActiveMQ Enhancements to JMS

The JMS (Java Message Service) specification is very well-known for those working with messaging platforms but it has been around for quite some time and honestly not getting updates lately which gives a lot of room for enhancements and extensions.

As you can imagine Apache ActiveMQ goes beyond the JMS spec and implement lots of cool things where you can gain more in functionality, performance and scalability.

Starting from the top ConnectionFactory object, ActiveMQ has its own called ActiveMQConnectionFactory, as other JMS providers also create their own specific factories, ActiveMQ enhances the JMS with some settings that you can activate right away with little configuration and definitely see gains in performance.  Of course, when you optimize for performance, most of the time, you have the trade-off of more CPU utilization but I think CPU cycles are getting really cheap when comparing with network bandwidth and disk I/O.

Here is a list of things you can use to optimize performance…

FuseSource Tour in Brazil

Image
I had the pleasure to spend a week in Brazil doing a FuseSource Tour in two of the major cities... Sao Paulo and Rio de Janeiro. It's pretty clear that the Open Source community is growing really fast and the integration and messaging opportunities are hot.

Unfortunately, I couldn't visit all of the prospective partners and customers that had contacted us because we couldn't find a single empty spot on the agenda but I think the tour was an amazing experience and I'm pretty I'll back in the near future for more fun with the techies.

Some of the things I realized while traveling throughout Brazil is that the traffic is really crazy and made me remember some other cities like Los Angeles or Mexico City... You have to be really creative in terms of logistics to be able to meet more than two customers in the same day especially in Sao Paulo.

Food was a big surprise and it was pretty good either in Sao Paulo or Rio and I met nice and friendly people all over the place..…

Using the MINA component in Apache Camel

Image
You may find yourself trying to solve an integration problem where one of the systems doesn't "talk" anything else other than TCP/IP or UDP/IP. At that point, you may start thinking about writing your own socket server or look for one in the Internet or even create your Camel component to do that.
Well, that's where the Apache Camel MINA component comes really handy and you don't need to reinvent the wheel.

Camel MINA is a transport component working with Apache MINA which is a network application framework that provides event-driven asynchronous API over various transports such as TCP/IP and UDP.

A very common use case is to deploy camel-mina as a proxy in a Camel route and then do whatever is needed with the data like converting it to the appropriate format for example.

To give you an example, here is something you can do easily to test how camel-mina can help you:

Using the FUSE IDE create a new FUSE Project and then open the default camel-context.xml file und…