21 Comments

  1. Nice article. Can we use this code for sending and receiving text messages?

    1. Author

      Thanks. Yes you can, but I’d stick to a JSON structure anyways. You can always wrap those text messages in a minimal JSON structure so you can extend it in future if you need it.

  2. Hi, I don’t want to use the @scheduled (fixedDelay=3000L) to send the messages every 3 seconds, I want to send the message exactly once. Can you suggest the changes I would need to make?

    1. Author

      It depends on the trigger you want to use to send that message. If you want to start the app, send a message and wait for it to be delivered to shut it down, you could use a CountDownLatch object. You can also expose a REST API and then trigger that message whenever you call it… Feel free to further detail what you want to do on the GitHub repository, maybe I or someone else can help.

  3. How can I get dynamic queue names here?

    1. Author

      I don’t know if I got exactly what you meant here. I used annotations in this guide to set up queues and exchanges but you can always create queues programmatically with Java, and that way you’d get dynamic queues.

  4. Very interesting article. I have done it before but with Spring Cloud Stream (using Spring Boot and RabbitMQ). Do you know what are the advantages of one approach over the other?

    1. Author

      Thanks! Spring Cloud Stream is an abstraction, implementing the pub-sub pattern in a generic way so you can pick the binder later without (in theory) changing much of your code: say RabbitMQ or Kafka. It might be interesting for example for people who are familiar with Spring Integration since it has native integration with it. As an abstraction though, it has also the inconvenient that if you want to use specific features, you have to write vendor-specific code.

  5. Thanks, but whenever I start Spring application, it logs that application started twice. Do you have any idea why this is happening?

    1. Author

      Could you report an issue in the Github repo attaching the stack trace? I can have a look at it.

      1. I have asked this question here: https://stackoverflow.com/q/47344882/8955751.
        You can find details there.
        I am not getting any stacktrace, since application is running correctly.
        Only my concern is, why spring application is logging that it started twice.

  6. Thanks, can u do Event Sourcing with RabbitMq

  7. Nice post! It helps us a lot with migration of our rabbits to spring boot

  8. Thank you very much for the article ! It was really helpful.

  9. Hi MOISÉS, You saved my day! Wonderful post…

  10. Thanks for this article, I’m relatively new to spring and I found it very useful. Good luck with your book 🙂

    1. Author

      Thanks for your feedback! I’ll try to cover this and some other topics on my book so feel free to show your interest on Leanpub if you want to get a good discount!

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.