title: Rails pub/sub with ActiveMQ
body: <p>I'd like my Rails app to be able to listen and publish to ActiveMQ queues. </p>
  
  <p><a href="https://dev.to/kirillshevch/build-messaging-between-ruby-rails-applications-with-activemq-4fin" rel="nofollow noreferrer">This article</a> gives examples of how to use a ruby STOMP client, and a gem <code>activemessaging</code> that integrates that client into a Rails app. The functionality there seems ideal, but the <code>activemessaging</code> gem seems to no longer be maintained. </p>
  
  <p>There are lots of resources on using rabbitMQ instead of ActiveMQ, but I'm trying to improve my Rails app's integration with an existing Java stack that's already using ActiveMQ.</p>
  
  <p>So does anyone know of a gem I can use to achieve similar functionality to that of the <code>activemessaging</code> gem? I can't find one, so failing that:</p>
  
  <p>How would I initialise a Stomp client with a persistent connection to my activeMQ instance inside the context of my Rails app, such that 1) The lifecycle of the client is tied to that of the ruby process running my app, not the request-response procedure, and 2) I get to consume to messages using code such as Active Record models or service objects defined in my app?</p>
  
  <p>Thanks in advance.</p>