private static DistributedPubSubMediator.Send wrapForPubSub(final Signal<?> signal) { return new DistributedPubSubMediator.Send(DISPATCHER_ACTOR_PATH, signal); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(RetrieveThings.class, rt -> handleRetrieveThings(rt, rt)) .match(SudoRetrieveThings.class, srt -> handleSudoRetrieveThings(srt, srt)) .match(DistributedPubSubMediator.Send.class, send -> { final Object msg = send.msg(); if (msg instanceof RetrieveThings) { handleRetrieveThings((RetrieveThings) msg, send); } else if (msg instanceof SudoRetrieveThings) { handleSudoRetrieveThings((SudoRetrieveThings) msg, send); } else { log.warning("Got unknown message: {}", send); unhandled(send); } }) .matchAny(m -> { log.warning("Got unknown message: {}", m); unhandled(m); }) .build(); }
private static DistributedPubSubMediator.Send mapStreamTriggerCommand( final SudoStreamModifiedEntities sudoStreamModifiedEntities) { return new DistributedPubSubMediator.Send(PoliciesMessagingConstants.POLICIES_STREAM_PROVIDER_ACTOR_PATH, sudoStreamModifiedEntities, true); }
private static DistributedPubSubMediator.Send mapStreamTriggerCommand( final SudoStreamModifiedEntities sudoStreamModifiedEntities) { return new DistributedPubSubMediator.Send(ThingsMessagingConstants.THINGS_STREAM_PROVIDER_ACTOR_PATH, sudoStreamModifiedEntities, true); } }
private void handleMessage(final Message message) throws JMSException { log.debug("Received Message: {}", message); final Command<?> command = buildCommandFromPublicProtocol(message); if (command != null) { traceCommand(command); log.info("Publishing '{}' from AMQP Message '{}'", command.getType(), message.getJMSMessageID()); pubSubMediator.tell(new DistributedPubSubMediator.Send(pubSubTargetActorPath, command, true), getSelf()); } }
private static DistributedPubSubMediator.Send mapStreamTriggerCommand( final SudoStreamModifiedEntities sudoStreamModifiedEntities) { return new DistributedPubSubMediator.Send(PoliciesMessagingConstants.POLICIES_STREAM_PROVIDER_ACTOR_PATH, sudoStreamModifiedEntities, true); }
private static DistributedPubSubMediator.Send mapStreamTriggerCommand( final SudoStreamModifiedEntities sudoStreamModifiedEntities) { return new DistributedPubSubMediator.Send(ThingsMessagingConstants.THINGS_STREAM_PROVIDER_ACTOR_PATH, sudoStreamModifiedEntities, true); } }
private static Consume<Object> forwardToThingSearchActor(final ActorRef pubSubMediator) { return Consume.of((message, sender) -> { final DistributedPubSubMediator.Send wrappedCommand = new DistributedPubSubMediator.Send(SEARCH_ACTOR_PATH, message); pubSubMediator.tell(wrappedCommand, sender); }); }