title: Avoiding duplicated messages on JMS/ActiveMQ
body: <p>Is there a way to suppress duplicated messages on a queue defined on ActiveMQ server?</p>
  
  <p>I tried to define manually JMSMessageID, (message.setJMSMessageID("uniqueid")), but server ignores this modification and deliver a message with built-in generated JMSMessageID.</p>
  
  <p>By specification, I didn't found a reference about how to deduplicate messages.</p>
  
  <p>In HornetQ, to deal with this problem, we need to declare the HQ specific property org.hornetq.core.message.impl.HDR_DUPLICATE_DETECTION_ID on message definition.</p>
  
  <p>i.e.:</p>
  
  <pre><code>Message jmsMessage = session.createMessage();
  String myUniqueID = "This is my unique id"; // Could use a UUID for this
  message.setStringProperty(HDR_DUPLICATE_DETECTION_ID.toString(), myUniqueID);
  </code></pre>
  
  <p>Somebody knows if there's a similar solution for ActiveMQ?</p>