org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSMessage

Here are the examples of the java api class org.apache.activemq.artemis.core.protocol.proton.converter.jms.ServerJMSMessage taken from open source projects.

1. ProtonMessageConverter#outbound()

View license
@Override
public Object outbound(ServerMessage messageOutbound, int deliveryCount) throws Exception {
    ServerJMSMessage jmsMessage = activeMQJMSVendor.wrapMessage(messageOutbound.getType(), messageOutbound, deliveryCount);
    jmsMessage.decode();
    if (jmsMessage.getBooleanProperty(prefixVendor + "NATIVE")) {
        if (jmsMessage instanceof BytesMessage) {
            return AMQPNativeOutboundTransformer.transform(outboundTransformer, (BytesMessage) jmsMessage);
        } else {
            return null;
        }
    } else {
        return outboundTransformer.convert(jmsMessage);
    }
}

2. ProtonMessageConverter#inboundJMSType()

View license
/**
    * Just create the JMS Part of the inbound (for testing)
    *
    * @param messageSource
    * @return
    * @throws Exception                    https://issues.jboss.org/browse/ENTMQ-1560
    */
public ServerJMSMessage inboundJMSType(EncodedMessage messageSource) throws Exception {
    EncodedMessage encodedMessageSource = messageSource;
    ServerJMSMessage transformedMessage = null;
    InboundTransformer transformer = inboundTransformer;
    while (transformer != null) {
        try {
            transformedMessage = (ServerJMSMessage) transformer.transform(encodedMessageSource);
            break;
        } catch (Exception e) {
            ActiveMQClientLogger.LOGGER.debug("Transform of message using [{}] transformer, failed" + inboundTransformer.getTransformerName());
            ActiveMQClientLogger.LOGGER.trace("Transformation error:", e);
            transformer = transformer.getFallbackTransformer();
        }
    }
    if (transformedMessage == null) {
        throw new IOException("Failed to transform incoming delivery, skipping.");
    }
    transformedMessage.encode();
    return transformedMessage;
}

3. ProtonMessageConverter#inbound()

View license
@Override
public ServerMessage inbound(Object messageSource) throws Exception {
    ServerJMSMessage jmsMessage = inboundJMSType((EncodedMessage) messageSource);
    return (ServerMessage) jmsMessage.getInnerMessage();
}