Search in sources :

Example 1 with ReactorOptions

use of org.apache.qpid.proton.reactor.ReactorOptions in project azure-iot-sdk-java by Azure.

the class AmqpsIotHubConnection method createReactor.

private Reactor createReactor() throws TransportException {
    try {
        ReactorOptions options = new ReactorOptions();
        // If this option isn't set, proton defaults to 16 * 1024 max frame size. This used to default to 4 * 1024,
        // and this change to 16 * 1024 broke the websocket implementation that we layer on top of proton-j.
        // By setting this frame size back to 4 * 1024, AMQPS_WS clients can send messages with payloads up to the
        // expected 256 * 1024 bytes. For more context, see https://github.com/Azure/azure-iot-sdk-java/issues/742
        options.setMaxFrameSize(MAX_FRAME_SIZE);
        if (this.authenticationType == DeviceClientConfig.AuthType.X509_CERTIFICATE) {
            // x509 authentication does not use SASL, so disable it
            options.setEnableSaslByDefault(false);
        }
        return Proton.reactor(options, this);
    } catch (IOException e) {
        throw new TransportException("Could not create Proton reactor", e);
    }
}
Also used : ReactorOptions(org.apache.qpid.proton.reactor.ReactorOptions) IOException(java.io.IOException) TransportException(com.microsoft.azure.sdk.iot.device.exceptions.TransportException)

Aggregations

TransportException (com.microsoft.azure.sdk.iot.device.exceptions.TransportException)1 IOException (java.io.IOException)1 ReactorOptions (org.apache.qpid.proton.reactor.ReactorOptions)1