• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

consumer not working as expected

 
Ranch Hand
Posts: 409
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a simple standalone consumer, trying to consume 4 messages sitting on the ActiveMQ. But when I started the application, it created another Queue with the same name as shown in the image below:




My Project Structure looks like this:





And code inside classes looks like the following:

class FebMessageConsumer

 
class FebMessageConsumerApplication

 

1) What's wrong in the above code?

2) Once I get above thing working,I plan on deploying it as a WAR to Apache Tomcat 8.5. Is it like when I deploy the application or start the application as Java Application, it's going to consume all the messages one by one? OR when I start the application, only one message will be consumed at a time and then I'll have to stop the application and then start again to consume next message?

Here's a Google Drive Link to the zipped project in case needed for reference.

https://drive.google.com/open?id=1IkULFZP-YT6u-fYRbrQetQGl1AkT85i-


 
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you check the page, you see that one has the queue name with quotes. That one comes from your application.properties file. These should contain values, not strings. You don't need to add quotes - any quotes you do add will be part of the value.
 
Jack Tauson
Ranch Hand
Posts: 409
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:If you check the page, you see that one has the queue name with quotes. That one comes from your application.properties file. These should contain values, not strings. You don't need to add quotes - any quotes you do add will be part of the value.



Thanks. That was the mistake. It works now.
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic