001/*
002 * Copyright 2002-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.jms.support;
018
019/**
020 * Pre-defined names and prefixes to be used for setting and/or retrieving
021 * JMS attributes from/to generic message headers.
022 *
023 * @author Mark Fisher
024 * @author Stephane Nicoll
025 * @since 4.1
026 */
027public interface JmsHeaders {
028
029        /**
030         * Prefix used for JMS API related headers in order to distinguish from
031         * user-defined headers and other internal headers (e.g. correlationId).
032         * @see SimpleJmsHeaderMapper
033         */
034        String PREFIX = "jms_";
035
036        /**
037         * Correlation ID for the message. This may be the {@link #MESSAGE_ID} of
038         * the message that this message replies to. It may also be an
039         * application-specific identifier.
040         * @see javax.jms.Message#getJMSCorrelationID()
041         */
042        String CORRELATION_ID = PREFIX + "correlationId";
043
044        /**
045         * Name of the destination (topic or queue) of the message.
046         * <p>Read-only value.
047         * @see javax.jms.Message#getJMSDestination()
048         * @see javax.jms.Destination
049         * @see javax.jms.Queue
050         * @see javax.jms.Topic
051         */
052        String DESTINATION = PREFIX + "destination";
053
054        /**
055         * Distribution mode.
056         * <p>Read-only value.
057         * @see javax.jms.Message#getJMSDeliveryMode()
058         * @see javax.jms.DeliveryMode
059         */
060        String DELIVERY_MODE = PREFIX + "deliveryMode";
061
062        /**
063         * Message expiration date and time.
064         * <p>Read-only value.
065         * @see javax.jms.Message#getJMSExpiration()
066         */
067        String EXPIRATION = PREFIX + "expiration";
068
069        /**
070         * Unique identifier for a message.
071         * <p>Read-only value.
072         * @see javax.jms.Message#getJMSMessageID()
073         */
074        String MESSAGE_ID = PREFIX + "messageId";
075
076        /**
077         * The message priority level.
078         * <p>Read-only value.
079         * @see javax.jms.Message#getJMSPriority()
080         */
081        String PRIORITY = PREFIX + "priority";
082
083        /**
084         * Name of the destination (topic or queue) the message replies should
085         * be sent to.
086         * @see javax.jms.Message#getJMSReplyTo()
087         */
088        String REPLY_TO = PREFIX + "replyTo";
089
090        /**
091         * Specify if the message was resent. This occurs when a message
092         * consumer fails to acknowledge the message reception.
093         * <p>Read-only value.
094         * @see javax.jms.Message#getJMSRedelivered()
095         */
096        String REDELIVERED = PREFIX + "redelivered";
097
098        /**
099         * Message type label. This type is a string value describing the message
100         * in a functional manner.
101         * @see javax.jms.Message#getJMSType()
102         */
103        String TYPE = PREFIX + "type";
104
105        /**
106         * Date and time of the message sending operation.
107         * <p>Read-only value.
108         * @see javax.jms.Message#getJMSTimestamp()
109         */
110        String TIMESTAMP = PREFIX + "timestamp";
111
112}