How to keep track of the number of Camel exchanges which have been executed in JBoss Fuse 6.1

Solution Unverified - Updated -

Issue

I have a jms subscriber which listens to a topic and consumes a message. I would like to create a variable called Count and set count=1 for first time and increment the counter for the next message.
After consuming 50 messages I would like take some action.

Environment

Red Hat JBoss Fuse 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content