public void attach(PhysicalConnectionSource source, ChannelTarget target, ChannelConnection connection) { if (source.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = target.getUri(); Channel channel = getChannel(uri, target.getChannelSide()); channel.attach(connection); connection.setCloseable(() -> { // no-op }); }
public void attach(PhysicalConnectionSource source, ChannelTarget target, ChannelConnection connection) { if (source.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = target.getUri(); Channel channel = getChannel(uri, target.getChannelSide()); channel.attach(connection); connection.setCloseable(() -> { // no-op }); }
@SuppressWarnings("unchecked") public void attach(PhysicalConnectionSource source, NATSConnectionTarget target, ChannelConnection connection) { Nats nats = connectionManager.getNats(target); if (!source.isDirectConnection()) { String topic = target.getTopic() != null ? target.getTopic() : target.getDefaultTopic(); String serializerName = target.getData().getSerializer(); Function<Object, String> serializer = serializerName != null ? InstanceResolver.getInstance(serializerName, info, cm) : null; connection.getEventStream().addHandler((event, batch) -> { String serialized = serializer != null ? serializer.apply(event) : event.toString(); nats.publish(topic, serialized); }); connection.setCloseable(() -> connectionManager.release(target.getChannelUri(), topic)); } }
PhysicalConnectionSource source = physicalConnection.getSource(); PhysicalConnectionTarget target = physicalConnection.getTarget(); if (source.isDirectConnection() || target.isDirectConnection()) { if (physicalConnection.isBound()) { Class<?> type = source.isDirectConnection() ? source.getServiceInterface() : target.getServiceInterface(); DirectConnectionFactory factory = connectionFactories.get(type); if (factory == null) {
PhysicalConnectionSource source = physicalConnection.getSource(); PhysicalConnectionTarget target = physicalConnection.getTarget(); if (source.isDirectConnection() || target.isDirectConnection()) { if (physicalConnection.isBound()) { Class<?> type = source.isDirectConnection() ? source.getServiceInterface() : target.getServiceInterface(); DirectConnectionFactory factory = connectionFactories.get(type); if (factory == null) {