DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more

ActiveMQ: High Performance Messaging Using LevelDB

Jason Sherman user avatar by
Jason Sherman
·
Jan. 15, 13 · Interview
Like (0)
Save
Tweet
Share
7.11K Views

Join the DZone community and get the full member experience.

Join For Free
ActiveMQ is already built for high performance and is one of the fastest brokers available but did you know it can be even faster by configuring the LevelDB message store?  LevelDB is a fast light weight key-value storage system which maps byte keys to byte values.

Not too long ago I came across an issue where the ActiveMQ broker seems to be experiencing a performance issue.  This issue arose from a very specific use case, none the less it has highlighted the exceptional performance of the LevelDB store.  This use case involved durable topic subscribers with selectors; one subscriber with no selector to receive all messages, one subscriber with a selector of "true", and one subscriber with a selector of "false".  A producer was then configure to alternate the property set on the message to "true" and "false".

Using the kahaDB store I saw that it would take upwards of 7 hours for 200,000 messages to be published to the broker.  Out of curiosity I switch to the LevelDB store and saw the exact same scenario only took 70 seconds.  This was absolutely amazing!

If you are interested in enabling the LevelDB store it can be configured with a couple simple steps.  Depending on the version of the broker you are running there are different instructions.

Fuse Distributions

First, download the fuse-leveldb-1.3-uber.jar (which is the latest at the time of this writing) and copy the JAR into the broker's lib directory.  Then, in the broker configuration file (activemq.xml) update the persistence adapter to use the LevelDB store as follows:
 <persistenceAdapter>  
  <bean xmlns="http://www.springframework.org/schema/beans"   
    class="org.fusesource.mq.leveldb.LevelDBStore">  
   <property name="directory" value="${activemq.base}/data/leveldb"/>  
   <property name="logSize" value="107374182"/>  
  </bean>  
 </persistenceAdapter> 
Apache Distributions

The Apache distribution of ActiveMQ 5.7 and greater come with the LevelDB library so all you need to do is enable the persistence adapter in the broker configuration:
 <persistenceAdapter>  
  <levelDB directory="${activemq.base}/data/leveldb" logSize="107374182"/>  
 </persistenceAdapter>  
That's all there is to it.  For more information on the ActiveMQ LevelDB store and performance metrics check out the GitHub project page at FuseMQ-LevelDB.  For a list of all the available binaries for the fuse-leveldb library have a look at this fusesource repository.


LevelDB

Published at DZone with permission of Jason Sherman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Build an Automated Testing Pipeline With GitLab CI/CD and Selenium Grid
  • Practical Example of Using CSS Layer
  • Use Golang for Data Processing With Amazon Kinesis and AWS Lambda
  • 7 Most Sought-After Front-End Frameworks for Web Developers

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: