Search in sources :

Example 1 with MessageConverter

use of org.apache.qpid.server.plugin.MessageConverter in project qpid-broker-j by apache.

the class ManagementNode method enqueue.

@Override
public void enqueue(final ServerMessage message, final Action<? super MessageInstance> action, final MessageEnqueueRecord record) {
    @SuppressWarnings("unchecked") MessageConverter<ServerMessage, InternalMessage> converter = (MessageConverter<ServerMessage, InternalMessage>) MessageConverterRegistry.getConverter((message.getClass()), InternalMessage.class);
    final InternalMessage msg = converter.convert(message, _addressSpace);
    try {
        if (action != null) {
            action.performAction(new ConsumedMessageInstance(msg));
        }
        processRequest(msg);
    } finally {
        converter.dispose(msg);
    }
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) ServerMessage(org.apache.qpid.server.message.ServerMessage) MessageConverter(org.apache.qpid.server.plugin.MessageConverter)

Aggregations

ServerMessage (org.apache.qpid.server.message.ServerMessage)1 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)1 MessageConverter (org.apache.qpid.server.plugin.MessageConverter)1