This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

consumer not working as expected  RSS feed

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • 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: 21653
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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: 97
  • Mark post as helpful
  • send pies
  • 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: 21653
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!