/*
 * Copyright 2016 Erik Wramner.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package name.wramner.jmstools.messages;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

/**
 * A message provider can create JMS messages enriched with a checksum property that can be checked on the other side.
 * 
 * @author Erik Wramner
 */
public interface MessageProvider {
    static final String UNIQUE_MESSAGE_ID_PROPERTY_NAME = "Unique-Message-Id";
    static final String CHECKSUM_PROPERTY_NAME = "Payload-Checksum-MD5";
    static final String LENGTH_PROPERTY_NAME = "Payload-Length";

    /**
     * Create message with checksum and length properties.
     *
     * @param session The JMS session.
     * @return message.
     * @throws JMSException on JMS errors.
     */
    Message createMessageWithPayloadAndChecksumProperty(Session session) throws JMSException;
}
@@ -857,16 +857,131 @@
  side.%0D%0A
+ * %3Cp%3E%0D%0A * Note that according to the JMS standard property names must follow the same rules as Java identifiers.%0D%0A
  * %0D%0A * 
@@ -1106,23 +1106,31 @@
  = %22
+EWJMSTools
 Unique
--
 Message
--
 Id%22;
@@ -1185,24 +1185,33 @@
  = %22
+EWJMSTools
 Payload
--
 Checksum
 -MD5
@@ -1206,17 +1206,16 @@
 Checksum
--
 MD5%22;%0D%0A 
@@ -1265,16 +1265,25 @@
  = %22
+EWJMSTools
 Payload
--
 Leng

Rename property names to follow JMS standard for identifiers.