@Override public void publish(MessagingContext ctx, Message msg) throws IOException { String ownerId = AbstractRoutingClient.buildOwnerId( RecipientKind.AGENTS, this.applicationName, this.scopedInstancePath); this.logger.fine(getId() + " is about to publish a message (" + msg + ") to " + ownerId); HttpUtils.sendAsynchronously( new HttpMessage(ownerId, msg, ctx), this.clientSession.getRemote()); }
@Override public void unsubscribe(MessagingContext ctx) throws IOException { String ownerId = AbstractRoutingClient.buildOwnerId( RecipientKind.AGENTS, this.applicationName, this.scopedInstancePath); this.logger.fine(getId() + " is about to unsubscribe to " + ownerId); HttpUtils.sendAsynchronously( new SubscriptionMessage(ownerId, ctx, false), this.clientSession.getRemote()); }