public class ConversationMessage extends CommandMessage
public class SomeService implements MessageCallback { public void callback(CommandMessage message) { ConversationMessage.create(message) // create a ConversationMessage that // references the incoming message .setSubject("ClientService") // specify the service on the sending // bus that should receive the message .set("Text", "Hello, World!").sendNowWith(messageBusInstance); // send // the // message } }It is possible for a message sender to specify a
ReplyTo
message component, which by default will be used to route the message. We
refer to this as a sender-driven conversation as opposed to a
receiver-driven conversation which is demonstrated in the code
example above.Modifier and Type | Method and Description |
---|---|
static ConversationMessage |
create(Enum<?> commandType,
Message inReplyTo)
Creates a new ConversationMessage with the specified command type and
reference message.
|
static ConversationMessage |
create(Message inReplyTo)
Creates a new ConversationMessage using an incoming message as a reference.
|
static ConversationMessage |
create(String commandType,
Message inReplyTo)
Creates a new ConversationMessage with the specified command type and
reference message.
|
addAllParts, addAllProvidedParts, addResources, command, command, commit, copy, copy, copyResource, create, createWithParts, createWithParts, createWithParts, createWithPartsFromRawMap, errorsCall, get, get, getCommandType, getErrorCallback, getParts, getProvidedParts, getResource, getSubject, getValue, hasPart, hasPart, hasResource, isCommited, isFlagSet, remove, remove, sendNowWith, sendNowWith, set, set, setFlag, setParts, setProvidedPart, setProvidedPart, setResource, toString, toSubject, unsetFlag
public static ConversationMessage create(Message inReplyTo)
inReplyTo
- the incoming message.inReplyTo
message.public static ConversationMessage create(Enum<?> commandType, Message inReplyTo)
commandType
- The command type for this message. Command is an optional
extension for creating services that can respond to different
specific commands. Must not be null.inReplyTo
- the incoming message. Must not be null.public static ConversationMessage create(String commandType, Message inReplyTo)
commandType
- The command type for this message. Command is an optional
extension for creating services that can respond to different
specific commands. Must not be null.inReplyTo
- the incoming message. Must not be null.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.