Skip to content

Commit

Permalink
dispatch signals to concierge without relying on type distinction
Browse files Browse the repository at this point in the history
Signals are now delegated to an enforcer if it has a nonempty ID
and to the dispatcher if it has an empty ID.

Signed-off-by: Cai Yufei (INST/ECS1) <yufei.cai@bosch-si.com>
  • Loading branch information
yufei-cai committed Apr 13, 2018
1 parent 4dddde1 commit 30243ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -44,7 +44,7 @@ public ConciergeEnvelope(final ActorRef pubSubMediator, final ActorRef enforcerS
}

public void dispatch(final Signal<?> signal, final ActorRef sender) {
if (signal instanceof ThingSearchCommand || signal instanceof RetrieveThings) {
if (signal.getId().isEmpty()) {
pubSubMediator.tell(wrapForPubSub(signal), sender);
} else {
enforcerShardRegion.tell(wrapForEnforcer(signal), sender);
Expand Down
Expand Up @@ -216,7 +216,7 @@ public Optional<JsonFieldSelector> getSelectedFields() {

@Override
public String getThingId() {
return ":_";
return "";
}

@Override
Expand Down

0 comments on commit 30243ce

Please sign in to comment.