Search in sources :

Example 1 with WireFormatNegotiator

use of org.apache.activemq.transport.WireFormatNegotiator in project activemq-artemis by apache.

the class TcpTransportFactory method compositeConfigure.

@Override
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
    TcpTransport tcpTransport = transport.narrow(TcpTransport.class);
    IntrospectionSupport.setProperties(tcpTransport, options);
    Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket.");
    tcpTransport.setSocketOptions(socketOptions);
    if (tcpTransport.isTrace()) {
        try {
            transport = TransportLoggerSupport.createTransportLogger(transport, tcpTransport.getLogWriterName(), tcpTransport.isDynamicManagement(), tcpTransport.isStartLogging(), tcpTransport.getJmxPort());
        } catch (Throwable e) {
            LOG.error("Could not create TransportLogger object for: " + tcpTransport.getLogWriterName() + ", reason: " + e, e);
        }
    }
    boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true"));
    if (useInactivityMonitor && isUseInactivityMonitor(transport)) {
        transport = createInactivityMonitor(transport, format);
        IntrospectionSupport.setProperties(transport, options);
    }
    // Only need the WireFormatNegotiator if using openwire
    if (format instanceof OpenWireFormat) {
        transport = new WireFormatNegotiator(transport, (OpenWireFormat) format, tcpTransport.getMinmumWireFormatVersion());
    }
    return super.compositeConfigure(transport, format, options);
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat) WireFormatNegotiator(org.apache.activemq.transport.WireFormatNegotiator)

Aggregations

OpenWireFormat (org.apache.activemq.openwire.OpenWireFormat)1 WireFormatNegotiator (org.apache.activemq.transport.WireFormatNegotiator)1