Connection has to be associated with Reactor before Creating a receiver on it.
191609
public static CompletableFuture<MessageReceiver> create(
            final MessagingFactory factory,
            final String name,
            final String recvPath,
            final int prefetchCount,
            final ReceiverSettingsProvider settingsProvider) {
        MessageReceiver msgReceiver = new MessageReceiver(
                factory,
                name,
                recvPath,
                prefetchCount,
                settingsProvider);
        return msgReceiver.createLink();
    }
547534
@Override
    public boolean ensureConnected () throws SmbException {
        try {
            return super.connect(this.transportContext.getConfig().getResponseTimeout());
        }
        catch ( TransportException te ) {
            throw new SmbException("Failed to connect: " + this.address, te);
        }

    }
131580
private void associateConnection(ManagedConnectionFactory mcf,
                                     Subject subject,
                                     ConnectionRequestInfo cri,
                                     Object connection) throws ResourceException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "associateConnection");

        UOWCurrent uowCurrent = (UOWCurrent) _pm.connectorSvc.transactionManager;
        UOWCoordinator uowCoord = uowCurrent == null ? null : uowCurrent.getUOWCoord();
        MCWrapper mcWrapper = null;
        Object credTokenObj = null;
        try { // Begin processing to get connection

            // Perform any security setup that may be needed
            // before we proceed to get a connection.

            credTokenObj = securityHelper.beforeGettingConnection(subject, cri);

            // Get an appropriate wrappered ManangedConnection.
            mcWrapper = allocateMCWrapper(mcf, cri,
                                          subject,
                                          uowCoord);

        } // end try block
        finally {
            // A "finally" clause is implemented to ensure
            // any thread identity pushed to the OS
            // thread is removed and the original identity
            // is restored.
            if (credTokenObj != null) {
                securityHelper.afterGettingConnection(subject, cri, credTokenObj);
            }
        }

        involveMCInTran(mcWrapper, uowCoord, this);

        // Reassociate the handle which was passed in with the ManagedConnection (via MCWrapper).
        // Note: since associateConnection is called to reassociate a smart handle which is
        //  currently not associated to any MC, the fromMCWrapper parm in the call below will
        //  be null.
        reassociateConnectionHandle(connection, null, mcWrapper, uowCoord);

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "associateConnection");

    }
837981
@Override
	public synchronized ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
    {
        checkNotClosed();
        throw new FFMQException("Unsupported feature","UNSUPPORTED_FEATURE");
    }
123156
protected void ensureLinkingOperation() {
		if (!this.hasLinkingOperation) {
			this.hasLinkingOperation = true;
			final XExpression target = getExpression().getTarget();
			if (!hasReceiver()) {
				// Static call
				this.receiver = null;
				this.argument = target;
			} else if (getOperation().getParameters().isEmpty()) {
				// Call on the receiver instance
				this.receiver = target;
				this.argument = null;
			} else {
				// Call to an object that is not the target, with the target as arugment
				this.argument = target;

				final XExpression obj1 = this.description.getSyntacticReceiver();
				final XExpression obj2 = this.description.getImplicitFirstArgument();
				final XExpression obj3 = this.description.getImplicitReceiver();

				if (obj1 != null && obj1 != target) {
					this.receiver = obj1;
				} else if (obj2 != null && obj2 != target) {
					this.receiver = obj2;
				} else if (obj3 != target) {
					this.receiver = obj3;
				} else {
					this.receiver = null;
				}
			}
		}
	}
720563
private int prepareConnectionForBatch(Connection conn) throws SQLException {
        conn.setAutoCommit(false);
        int initialIsolation = Connection.TRANSACTION_REPEATABLE_READ;
        if (_isDB2)
        {
            try
            {
                initialIsolation = conn.getTransactionIsolation();
                if (Connection.TRANSACTION_REPEATABLE_READ != initialIsolation && Connection.TRANSACTION_SERIALIZABLE != initialIsolation)
                {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Transaction isolation level was " + initialIsolation + " , setting to TRANSACTION_REPEATABLE_READ");
                    conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
                }
            } catch (Exception e)
            {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "setTransactionIsolation to RR threw Exception. Transaction isolation level was " + initialIsolation + " ", e);
                FFDCFilter.processException(e, "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.prepareConnectionForBatch", "3668", this);
                if (!isolationFailureReported)
                {
                    isolationFailureReported = true;
                    Tr.warning(tc, "CWRLS0024_EXC_DURING_RECOVERY", e);
                }
                // returning RR will prevent closeConnectionAfterBatch resetting isolation level
                initialIsolation = Connection.TRANSACTION_REPEATABLE_READ;
            }
        }
        return initialIsolation;
    }
288821
function Connector(src, onconnect) {
  events.EventEmitter.call(this);

  this.src = src;

  this.once('result', function (err, socket) {
    socket.removeAllListeners('error');
    if (err) {
      this.emit('prefailed', err);
      this.emit('failed', err);
    } else {
      this.emit('preready', socket);
      this.emit('ready', socket);
    }
  }).on('ready', function (socket) {
    onconnect(socket);
  }).on('failed', function (err) {
    src.emit('error', err);
  });
}
565870
protected B connection(Http2Connection connection) {
        enforceConstraint("connection", "maxReservedStreams", maxReservedStreams);
        enforceConstraint("connection", "server", isServer);
        enforceConstraint("connection", "codec", decoder);
        enforceConstraint("connection", "codec", encoder);

        this.connection = checkNotNull(connection, "connection");

        return self();
    }
115678
@Override
    public void addObserver(Observer observer) {
        super.addObserver(observer);
        if (countObservers() > 1) {
            super.deleteObserver(observer);
            AbstractConnectionFactoryService cfSvc = (AbstractConnectionFactoryService) observer;
            Object[] params = new Object[] { CONNECTION_MANAGER, name, cfSvc.getConfigElementName() };
            RuntimeException failure = connectorSvc.ignoreWarnOrFail(tc, null, UnsupportedOperationException.class, "CARDINALITY_ERROR_J2CA8040", params);
            if (failure != null)
                throw failure;
        }
    }
371383
@Override
  public void connect(
      ChannelHandlerContext ctx,
      SocketAddress remoteAddress,
      SocketAddress localAddress,
      ChannelPromise promise) throws Exception {
    final class ConnectListener implements ChannelFutureListener {
      @Override
      public void operationComplete(ChannelFuture future) {
        if (!future.isSuccess()) {
          failWrites(future.cause());
        }
      }
    }

    super.connect(ctx, remoteAddress, localAddress, promise);
    promise.addListener(new ConnectListener());
  }
232195
CompletableFuture<Void> connect(LocalConnection connection) {
    LocalConnection localConnection = new LocalConnection(listener.context, connections);
    connections.add(localConnection);
    connection.connect(localConnection);
    localConnection.connect(connection);
    return CompletableFuture.runAsync(() -> listener.listener.accept(localConnection), listener.context.executor());
  }
1249244
void establishConnection () throws IOException {
        synchronized (operationOnConnectionMonitor) {
            if (state == State.CLOSED) {
                throw new IOException("Attempt to establish a connection with a closed connection factory");
            } else if (state == State.CONNECTED) {
                LOGGER.warn("Establishing new connection although a connection is already established");
            }
            try {
                LOGGER.info("Trying to establish connection to {}:{}", getHost(), getPort());
                connection = super.newConnection(executorService);
                connection.addShutdownListener(connectionShutdownListener);
                LOGGER.info("Established connection to {}:{}", getHost(), getPort());
                changeState(State.CONNECTED);
            } catch (IOException e) {
                LOGGER.error("Failed to establish connection to {}:{}", getHost(), getPort());
                throw e;
            }
        }
    }
1081158
def _ensure_reactor_running():
    
    if not reactor.running:
        
        # Some of the `signal` API can only be called
        # from the main-thread. So we do a dirty workaround.
        #
        # `signal.signal()` and `signal.wakeup_fd_capture()`
        # are temporarily monkey-patched while the reactor is
        # starting.
        #
        # The patched functions record the invocations in
        # `signal_registrations`. 
        #
        # Once the reactor is started, the main-thread
        # is used to playback the recorded invocations.
        
        signal_registrations = []

        # do the monkey patching
        def signal_capture(*args, **kwargs):
            signal_registrations.append((orig_signal, args, kwargs))
        def set_wakeup_fd_capture(*args, **kwargs):
            signal_registrations.append((orig_set_wakeup_fd, args, kwargs))
        orig_signal = signal.signal
        signal.signal = signal_capture
        orig_set_wakeup_fd = signal.set_wakeup_fd
        signal.set_wakeup_fd = set_wakeup_fd_capture
        
        
        # start the reactor in a daemon-thread
        reactor_thread = threading.Thread(target=reactor.run, name="reactor")
        reactor_thread.daemon = True
        reactor_thread.start()
        while not reactor.running:
            time.sleep(0.01)
            
        # Give the reactor a moment to register the signals. 
        # Apparently the 'running' flag is set before that.
        time.sleep(0.01)
        
        # Undo the monkey-paching
        signal.signal = orig_signal
        signal.set_wakeup_fd = orig_set_wakeup_fd
        
        # Playback the recorded calls
        for func, args, kwargs in signal_registrations:
            func(*args, **kwargs)
746618
public void bind()
    throws Exception
  {
    if (_isBind.getAndSet(true)) {
      return;
    }

    if (_protocol == null) {
      throw new IllegalStateException(L.l("'{0}' must have a configured protocol before starting.", this));
    }

    // server 1e07
    if (_port < 0 && _unixPath == null) {
      return;
    }

    SocketSystem system = SocketSystem.current();

    if (_throttle == null) {
      _throttle = new ThrottleSocket();
    }
    
    //String protocolName = _protocol.name();
    
    String ssl = _sslFactory != null ? "s" : "";

    if (_serverSocket != null) {
      InetAddress address = _serverSocket.getLocalAddress();
      
      if (address != null)
        log.info("listening to " + address.getHostName() + ":" + _serverSocket.getLocalPort());
      else
        log.info("listening to *:" + _serverSocket.getLocalPort());
    }
    /*
    else if (_sslFactory != null && _socketAddress != null) {
      _serverSocket = _sslFactory.create(_socketAddress, _port);

      log.info(protocolName + "s listening to " + _socketAddress.getHostName() + ":" + _port);
    }
    else if (_sslFactory != null) {
      if (_address == null) {
        _serverSocket = _sslFactory.create(null, _port);
        log.info(protocolName + "s listening to *:" + _port);
      }
      else {
        InetAddress addr = InetAddress.getByName(_address);

        _serverSocket = _sslFactory.create(addr, _port);

        log.info(protocolName + "s listening to " + _address + ":" + _port);
      }
    }
    */
    else if (_socketAddress != null) {
      _serverSocket = system.openServerSocket(_socketAddress, _port,
                                              _acceptListenBacklog,
                                              _isEnableJni);
      
      log.info(_protocol.name() + ssl + " listening to " + _socketAddress.getHostName() + ":" + _serverSocket.getLocalPort());
    }
    else {
      _serverSocket = system.openServerSocket(null, _port, _acceptListenBacklog,
                                              _isEnableJni);
      
      log.info(_protocol.name() + ssl + " listening to *:"
               + _serverSocket.getLocalPort());
    }

    assert(_serverSocket != null);

    postBind();
  }
866728
def _call_in_reactor_thread(self, f, *args, **kwargs):
        """"""
        self._reactor.callFromThread(f, *args, **kwargs)
975163
def add_outbound_connection(self, uri):
        
        LOGGER.debug("Adding connection to %s", uri)
        conn = OutboundConnection(
            connections=self._connections,
            endpoint=uri,
            dispatcher=self._dispatcher,
            zmq_identity=self._zmq_identity,
            secured=self._secured,
            server_public_key=self._server_public_key,
            server_private_key=self._server_private_key,
            future_callback_threadpool=self._future_callback_threadpool,
            heartbeat=True,
            connection_timeout=self._connection_timeout)

        self.outbound_connections[uri] = conn
        conn.start()

        self._add_connection(conn, uri)

        connect_message = ConnectionRequest(endpoint=self._public_endpoint)
        conn.send(
            validator_pb2.Message.NETWORK_CONNECT,
            connect_message.SerializeToString(),
            callback=partial(
                self._connect_callback,
                connection=conn,
            ))

        return conn
540063
private void createSingleListener(final SibRaMessagingEngineConnection connection) throws ResourceException
    {
        final String methodName = "createSingleListener";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName, connection);
        }

        final SIDestinationAddress destination = _endpointConfiguration.getDestination();

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
        {
            SibTr.debug(TRACE, "Creating a consumer to consume from destination "
                               + destination + " on ME " + connection.getConnection().getMeName());
        }

        try
        {
            connection.createListener(destination, _messageEndpointFactory);
            SibTr.info(TRACE, "CONNECTED_CWSIV0777", new Object[] {
                                                                   connection.getConnection().getMeName(),
                                                                   _endpointConfiguration.getDestination()
                                                                                   .getDestinationName(),
                                                                   _endpointConfiguration.getBusName() });
        } catch (final IllegalStateException exception)
        {
            // No FFDC code needed
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
            {
                SibTr.debug(TRACE, "Failed to create a session - blowing away the connection - rethrow the exception");
            }

            _connections.remove(connection.getConnection().getMeUuid());
            connection.close();
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
            {
                SibTr.exit(this, TRACE, methodName);
            }
            throw exception;
        } catch (final ResourceException exception)
        {
            // No FFDC code needed

            // Failed to create a consumer so blow away the connection and try
            // again
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
            {
                SibTr.debug(TRACE, "Failed to create a session - blowing away the connection - a retry should occur");
                SibTr.debug(TRACE, "Exception cause was " + exception.getCause());
            }

            _connections.remove(connection.getConnection().getMeUuid());
            connection.close();
            throw exception;
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }
    }