/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ using System; namespace Apache.NMS { /// /// Represents a message either to be sent to a message broker or received from a message broker. /// public interface IMessage { /// /// If using client acknowledgement mode on the session, then this method will acknowledge that the /// message has been processed correctly. /// void Acknowledge(); /// /// Clears out the message body. Clearing a message's body does not clear its header /// values or property entries. /// /// If this message body was read-only, calling this method leaves the message body in /// the same state as an empty body in a newly created message. /// void ClearBody(); /// /// Clears a message's properties. /// /// The message's header fields and body are not cleared. /// void ClearProperties(); /// /// Provides access to the message properties (headers). /// IPrimitiveMap Properties { get; } /// /// The correlation ID used to correlate messages from conversations or long running business processes. /// string NMSCorrelationID { get; set; } /// /// The destination of the message. This property is set by the IMessageProducer. /// IDestination NMSDestination { get; } /// /// The amount of time for which this message is valid. Zero if this message does not expire. /// TimeSpan NMSTimeToLive { get; set; } /// /// The message ID which is set by the provider. /// string NMSMessageId { get; } /// /// Whether or not this message is persistent. /// MsgDeliveryMode NMSDeliveryMode { get; set; } /// /// The Priority of this message. /// MsgPriority NMSPriority { get; set; } /// /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully. /// bool NMSRedelivered { get; } /// /// The destination that the consumer of this message should send replies to /// IDestination NMSReplyTo { get; set; } /// /// The timestamp of when the message was pubished in UTC time. If the publisher disables setting /// the timestamp on the message, the time will be set to the start of the UNIX epoc (1970-01-01 00:00:00). /// DateTime NMSTimestamp { get; } /// /// The type name of this message. /// string NMSType { get; set; } } }