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
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

Solution to Camel-HTTP Component Performance Problems

Learn how to solve a problem with the camel-http component preventing concurrent processing and slowing down processing time.

Diego Lanfranchi de Oliveira user avatar by
Diego Lanfranchi de Oliveira
·
Aug. 29, 18 · Tutorial
Like (3)
Save
Tweet
Share
4.93K Views

Join the DZone community and get the full member experience.

Join For Free

Today, I'm posting a simple solution to a problem that I was having. Maybe some of you are having this same problem as well.

Context: A camel route that takes 10 exchanges at once from a queue and sends to a webservice.

Problem: Processing time seems too slow and it's not working like I was expecting.

Code:

from("activemq:queue:process1?concurrentConsumers=10")
.to("http://ws.someservice.com/v1/resource");

Reading the code above, we may expect there will be ten threads calling the web service at once, right? But using some logs and running tests, I realized the camel-http component was creating a sort of internal queue and making only two calls at once, not respecting concurrent processing.

Solution: After a headache, I resolved this problem using the camel-jetty component at the beginning of the line.

New code:

from("activemq:queue:process1?concurrentConsumers=10")
.to("jetty:http://ws.someservice.com/v1/resource");

Then, rerunning the tests, I saw that the problem was solved! The application was consuming ten exchanges at once and sending them to the web service at the same time.

That's all. I hope this information may be useful to you.

Web Service Testing Processing application IT Sort (Unix)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is Browser Sandboxing?
  • TDD: From Katas to Production Code
  • How to Create a Dockerfile?
  • Continuous Development: Building the Thing Right, to Build the Right Thing

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: