title: Can ActiveMQ Artemis play undelivered messages to STOMP clients?
body: <p>If I'm running a broker with <code>persistence-enabled</code> set to <code>true</code> that has received some messages to a queue, is there any way to configure it to send messages to new STOMP clients that connect after the messages have arrived?</p>
  
  <p>The idea here being that maybe my queue workers have been stopped and I would like them to resume any work that has accumulated over the period they were not running.</p>
  
  <p>Currently when my STOMP consumers connect to a queue messages that are buffered up don't end up being handled. By "buffered up" I mean that producers have written messages to the queue while no consumers were connected. Continuing with that scenario, when my consumers connect, they are able to see messages, but only new ones. Any prior messages never end up being sent to a consumer.</p>
  
  <p>Broker Config</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0'?&gt;
  &lt;configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd"&gt;
  
      &lt;core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq:core "&gt;
  
          &lt;name&gt;0.0.0.0&lt;/name&gt;
  
          &lt;persistence-enabled&gt;true&lt;/persistence-enabled&gt;
  
          &lt;!-- this could be ASYNCIO, MAPPED, NIO
              ASYNCIO: Linux Libaio
              MAPPED: mmap files
              NIO: Plain Java Files
          --&gt;
          &lt;journal-type&gt;ASYNCIO&lt;/journal-type&gt;
  
          &lt;paging-directory&gt;data/paging&lt;/paging-directory&gt;
          &lt;bindings-directory&gt;data/bindings&lt;/bindings-directory&gt;
          &lt;journal-directory&gt;data/journal&lt;/journal-directory&gt;
          &lt;large-messages-directory&gt;data/large-messages&lt;/large-messages-directory&gt;
  
          &lt;journal-datasync&gt;true&lt;/journal-datasync&gt;
          &lt;journal-min-files&gt;2&lt;/journal-min-files&gt;
          &lt;journal-pool-files&gt;10&lt;/journal-pool-files&gt;
          &lt;journal-device-block-size&gt;4096&lt;/journal-device-block-size&gt;
          &lt;journal-file-size&gt;10M&lt;/journal-file-size&gt;
  
          &lt;!--
          This value was determined through a calculation.
          Your system could perform 50 writes per millisecond
          on the current journal configuration.
          That translates as a sync write every 20000 nanoseconds.
  
          Note: If you specify 0 the system will perform writes directly to the disk.
                  We recommend this to be 0 if you are using journalType=MAPPED and journal-datasync=false.
          --&gt;
          &lt;journal-buffer-timeout&gt;20000&lt;/journal-buffer-timeout&gt;
  
          &lt;!--
          When using ASYNCIO, this will determine the writing queue depth for libaio.
          --&gt;
          &lt;journal-max-io&gt;4096&lt;/journal-max-io&gt;
          &lt;!--
          You can verify the network health of a particular NIC by specifying the &lt;network-check-NIC&gt; element.
              &lt;network-check-NIC&gt;theNicName&lt;/network-check-NIC&gt;
          --&gt;
  
          &lt;!--
          Use this to use an HTTP server to validate the network
              &lt;network-check-URL-list&gt;http://www.apache.org&lt;/network-check-URL-list&gt; --&gt;
  
          &lt;!-- &lt;network-check-period&gt;10000&lt;/network-check-period&gt; --&gt;
          &lt;!-- &lt;network-check-timeout&gt;1000&lt;/network-check-timeout&gt; --&gt;
  
          &lt;!-- this is a comma separated list, no spaces, just DNS or IPs
              it should accept IPV6
  
              Warning: Make sure you understand your network topology as this is meant to validate if your network is valid.
                      Using IPs that could eventually disappear or be partially visible may defeat the purpose.
                      You can use a list of multiple IPs, and if any successful ping will make the server OK to continue running --&gt;
          &lt;!-- &lt;network-check-list&gt;10.0.0.1&lt;/network-check-list&gt; --&gt;
  
          &lt;!-- use this to customize the ping used for ipv4 addresses --&gt;
          &lt;!-- &lt;network-check-ping-command&gt;ping -c 1 -t %d %s&lt;/network-check-ping-command&gt; --&gt;
  
          &lt;!-- use this to customize the ping used for ipv6 addresses --&gt;
          &lt;!-- &lt;network-check-ping6-command&gt;ping6 -c 1 %2$s&lt;/network-check-ping6-command&gt; --&gt;
  
          &lt;!-- how often we are looking for how many bytes are being used on the disk in ms --&gt;
          &lt;disk-scan-period&gt;5000&lt;/disk-scan-period&gt;
  
          &lt;!-- once the disk hits this limit the system will block, or close the connection in certain protocols
              that won't support flow control. --&gt;
          &lt;max-disk-usage&gt;90&lt;/max-disk-usage&gt;
          &lt;!-- should the broker detect dead locks and other issues --&gt;
          &lt;critical-analyzer&gt;true&lt;/critical-analyzer&gt;
          &lt;critical-analyzer-timeout&gt;120000&lt;/critical-analyzer-timeout&gt;
          &lt;critical-analyzer-check-period&gt;60000&lt;/critical-analyzer-check-period&gt;
          &lt;critical-analyzer-policy&gt;HALT&lt;/critical-analyzer-policy&gt;
          &lt;page-sync-timeout&gt;1020000&lt;/page-sync-timeout&gt;
  
          &lt;acceptors&gt;
              &lt;acceptor name="artemis"&gt;tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true&lt;/acceptor&gt;
              &lt;acceptor name="stomp"&gt;tcp://0.0.0.0:61613?stompEnableMessageId=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true&lt;/acceptor&gt;
          &lt;/acceptors&gt;
  
          &lt;connectors&gt;
              &lt;connector name="global"&gt;tcp://172.17.0.1:61616&lt;/connector&gt;
              &lt;connector name="s"&gt;tcp://172.17.0.1:61617&lt;/connector&gt;
          &lt;/connectors&gt;
  
          &lt;cluster-user&gt;cluster&lt;/cluster-user&gt;
          &lt;cluster-password&gt;REDACTED&lt;/cluster-password&gt;
  
          &lt;cluster-connections&gt;
              &lt;cluster-connection name="multi-region"&gt;
                  &lt;connector-ref&gt;global&lt;/connector-ref&gt;
                  &lt;message-load-balancing&gt;ON_DEMAND&lt;/message-load-balancing&gt;
                  &lt;static-connectors&gt;
                      &lt;connector-ref&gt;s&lt;/connector-ref&gt;
                  &lt;/static-connectors&gt;
              &lt;/cluster-connection&gt;
          &lt;/cluster-connections&gt;
  
          &lt;addresses&gt;
              &lt;address name="/queue/global.regional"&gt;
                  &lt;multicast&gt;
                      &lt;queue name="/queue/global.regional"&gt;
                          &lt;durable&gt;true&lt;/durable&gt;
                      &lt;/queue&gt;
                  &lt;/multicast&gt;
              &lt;/address&gt;
          &lt;/addresses&gt;
  
          &lt;address-settings&gt;
  
              &lt;!-- if you define auto-create on certain queues, management has to be auto-create --&gt;
              &lt;address-setting match="activemq.management#"&gt;
                  &lt;dead-letter-address&gt;DLQ&lt;/dead-letter-address&gt;
                  &lt;expiry-address&gt;ExpiryQueue&lt;/expiry-address&gt;
                  &lt;redelivery-delay&gt;0&lt;/redelivery-delay&gt;
                  &lt;!-- with -1 only the global-max-size is in use for limiting --&gt;
                  &lt;max-size-bytes&gt;-1&lt;/max-size-bytes&gt;
                  &lt;message-counter-history-day-limit&gt;10&lt;/message-counter-history-day-limit&gt;
                  &lt;address-full-policy&gt;PAGE&lt;/address-full-policy&gt;
                  &lt;auto-create-queues&gt;true&lt;/auto-create-queues&gt;
                  &lt;auto-create-addresses&gt;true&lt;/auto-create-addresses&gt;
                  &lt;auto-create-jms-queues&gt;true&lt;/auto-create-jms-queues&gt;
                  &lt;auto-create-jms-topics&gt;true&lt;/auto-create-jms-topics&gt;
              &lt;/address-setting&gt;
  
              &lt;!--default for catch all--&gt;
              &lt;address-setting match="#"&gt;
                  &lt;!-- &lt;dead-letter-address&gt;DLQ&lt;/dead-letter-address&gt;
                  &lt;expiry-address&gt;ExpiryQueue&lt;/expiry-address&gt;
                  &lt;redelivery-delay&gt;0&lt;/redelivery-delay&gt; --&gt;
                  &lt;!-- with -1 only the global-max-size is in use for limiting --&gt;
                  &lt;!-- &lt;max-size-bytes&gt;-1&lt;/max-size-bytes&gt;
                  &lt;message-counter-history-day-limit&gt;10&lt;/message-counter-history-day-limit&gt;
                  &lt;address-full-policy&gt;PAGE&lt;/address-full-policy&gt;
                  &lt;auto-create-queues&gt;true&lt;/auto-create-queues&gt;
                  &lt;auto-create-addresses&gt;true&lt;/auto-create-addresses&gt;
                  &lt;auto-create-jms-queues&gt;true&lt;/auto-create-jms-queues&gt;
                  &lt;auto-create-jms-topics&gt;true&lt;/auto-create-jms-topics&gt; --&gt;
              &lt;/address-setting&gt;
          &lt;/address-settings&gt;
  
          &lt;security-settings&gt;
              &lt;security-setting match="#"&gt;
                  &lt;permission type="createNonDurableQueue" roles="amq"/&gt;
                  &lt;permission type="deleteNonDurableQueue" roles="amq"/&gt;
                  &lt;permission type="createDurableQueue" roles="amq"/&gt;
                  &lt;permission type="deleteDurableQueue" roles="amq"/&gt;
                  &lt;permission type="createAddress" roles="amq"/&gt;
                  &lt;permission type="deleteAddress" roles="amq"/&gt;
                  &lt;permission type="consume" roles="amq"/&gt;
                  &lt;permission type="browse" roles="amq"/&gt;
                  &lt;permission type="send" roles="amq"/&gt;
                  &lt;!-- we need this otherwise ./artemis data imp wouldn't work --&gt;
                  &lt;permission type="manage" roles="amq"/&gt;
              &lt;/security-setting&gt;
          &lt;/security-settings&gt;
  
      &lt;/core&gt;
  &lt;/configuration&gt;
  </code></pre>