Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9029147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:10:50+00:00 2026-06-16T07:10:50+00:00

Is there an easy way to create a copy of every message sent over

  • 0

Is there an easy way to create a copy of every message sent over a queue, so that if needed, the user could browse the list of previously transmitted messages and replay them numerous times with the click of a button?

I have program X that sends a message to a queue and program Y then reads it in. I would like to be able to replay a message that was previously sent without having to go back to program X and regenerate it again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:10:51+00:00Added an answer on June 16, 2026 at 7:10 am

    There are easy ways to get started, if you have not too many messages or too many queues.

    First, you could setup copying of messages to a “copy queue”. This has to be done once per queue with this strategy. Like this in activemq.xml

        <destinationInterceptors>
          <virtualDestinationInterceptor>
            <virtualDestinations>
              <compositeQueue name="INVOICE.OUT">
                <forwardTo>
                  <queue physicalName="INVOICE.IN" />
                  <queue physicalName="INVOICE.COPY" />
                </forwardTo>
              </compositeQueue>
            </virtualDestinations>
          </virtualDestinationInterceptor>
        </destinationInterceptors>
    

    Then use a tool to browse through the messages on the COPY queue, and if needed, resend them to the OUT queue. I like the Hermes JMS tool for such things.

    If you want something more fancy, you could read up on mirrored queues.

    There is another rather simple way to achieve easy copy of all messages.

    Use apache-camel that is bundled with activemq.
    This config inside camel.xml would achieve automatic copy of all messages to queues that begins with FOO.*
    This route would need some fixup of the copy queue name, but in priniple it works as a one time config for wiretapping.

    <route>
       <from uri="activemq:FOO.>"/>
       <setHeader headerName="CamelJMSDestination">
         <simple>COPY.${header.JMSDestination}</simple>
       </setHeader>
       <to uri="activemq:dummy"/>
    </route>
    

    A very important aspect here is that your server will fill up over time if you store all messages. I suggest you read up on ActiveMQ memory management or, just keep message copies for given timeframe. This can be automated in the sense that the sending system can actually set a message expiry so that messages get deleted automatically after a number of days/weeks/months.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way to create a multiline string literal in C#? Here's
Is there an easy way to create a list of only the time zones
Is there a easy way to create documentation pages based on xml documentation in
Is there an easy way to calculate the derivative of non-liner functions that are
Is there an easy way to copy a project in Visual Studio 2010 ?
Is there an easy way to copy a table to the same database of
Is there an easy way to add line number information to created nodes in
Is there an easy way to log PHP errors to a log for a
Is there an easy way to generate docs for REST api direct from a
Is there an easy way of getting the datetime of the last change to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.