Tabnine Logo
DistributedPubSubMediator$Subscribe.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
akka.cluster.pubsub.DistributedPubSubMediator$Subscribe
constructor

Best Java code snippets using akka.cluster.pubsub.DistributedPubSubMediator$Subscribe.<init> (Showing top 20 results out of 315)

origin: eclipse/ditto

private void subscribeForEvents() {
  checkConnectionNotNull();
  // unsubscribe to previously subscribed topics
  unsubscribeFromEvents();
  uniqueTopics = connection.getTargets().stream()
      .flatMap(target -> target.getTopics().stream().map(FilteredTopic::getTopic))
      .collect(Collectors.toSet());
  forEachPubSubTopicDo(pubSubTopic -> {
    final DistributedPubSubMediator.Subscribe subscribe =
        new DistributedPubSubMediator.Subscribe(pubSubTopic, PUB_SUB_GROUP_PREFIX + connectionId,
            getSelf());
    log.debug("Subscribing to pub-sub topic <{}> for connection <{}>.", pubSubTopic, connectionId);
    pubSubMediator.tell(subscribe, getSelf());
  });
}
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

private void subscribeForEvents() {
  checkConnectionNotNull();
  // unsubscribe to previously subscribed topics
  unsubscribeFromEvents();
  uniqueTopics = connection.getTargets().stream()
      .flatMap(target -> target.getTopics().stream().map(FilteredTopic::getTopic))
      .collect(Collectors.toSet());
  forEachPubSubTopicDo(pubSubTopic -> {
    final DistributedPubSubMediator.Subscribe subscribe =
        new DistributedPubSubMediator.Subscribe(pubSubTopic, PUB_SUB_GROUP_PREFIX + connectionId,
            getSelf());
    log.debug("Subscribing to pub-sub topic <{}> for connection <{}>.", pubSubTopic, connectionId);
    pubSubMediator.tell(subscribe, getSelf());
  });
}
origin: ks-no/eventstore2

@Override
public void preStart() {
  log.debug(getSelf().path().toString());
  try {
    ActorRef mediator =
        DistributedPubSub.get(getContext().system()).mediator();
    mediator.tell(new DistributedPubSubMediator.Subscribe(EventStore.EVENTSTOREMESSAGES, getSelf()),
        getSelf());
  } catch (ConfigurationException e){
    log.info("Not subscribing to eventstore event, no cluster system");
  }
  subscribe();
}
origin: at.researchstudio.sat/won-matcher-service

pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(WonNodeEvent.class.getName(), getSelf()), getSelf());
pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(HintEvent.class.getName(), getSelf()), getSelf());
pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(BulkHintEvent.class.getName(), getSelf()), getSelf());
origin: eclipse/ditto

pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ThingEvent.TYPE_PREFIX, UPDATER_GROUP, self()),
    self());
pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(PolicyEvent.TYPE_PREFIX, UPDATER_GROUP, self()),
    self());
origin: at.researchstudio.sat/won-matcher-service

pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(WonNodeEvent.class.getName(), getSelf()), getSelf());
pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(CrawlUriMessage.class.getName(), getSelf()), getSelf());
pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(
    ResourceCrawlUriMessage.class.getName(), getSelf()), getSelf());
origin: org.eclipse.ditto/ditto-services-thingsearch-updater-actors

private ThingsUpdater(final int numberOfShards,
    final ShardRegionFactory shardRegionFactory,
    final ThingsSearchUpdaterPersistence searchUpdaterPersistence,
    final CircuitBreaker circuitBreaker,
    final boolean eventProcessingActive,
    final Duration thingUpdaterActivityCheckInterval,
    final int maxBulkSize) {
  final ActorSystem actorSystem = context().system();
  // Start the proxy for the Things and Policies sharding, too.
  final ActorRef thingsShardRegion = shardRegionFactory.getThingsShardRegion(numberOfShards);
  final ActorRef policiesShardRegion = shardRegionFactory.getPoliciesShardRegion(numberOfShards);
  final ActorRef pubSubMediator = DistributedPubSub.get(actorSystem).mediator();
  final Props thingUpdaterProps =
      ThingUpdater.props(searchUpdaterPersistence, circuitBreaker, thingsShardRegion, policiesShardRegion,
          thingUpdaterActivityCheckInterval, ThingUpdater.DEFAULT_THINGS_TIMEOUT, maxBulkSize)
          .withMailbox("akka.actor.custom-updater-mailbox");
  shardRegion = shardRegionFactory.getSearchUpdaterShardRegion(numberOfShards, thingUpdaterProps);
  this.searchUpdaterPersistence = searchUpdaterPersistence;
  materializer = ActorMaterializer.create(getContext());
  retrieveStatisticsDetailsResponseSupplier = RetrieveStatisticsDetailsResponseSupplier.of(shardRegion,
      ThingsSearchConstants.SHARD_REGION, log);
  if (eventProcessingActive) {
    pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ThingEvent.TYPE_PREFIX, UPDATER_GROUP, self()),
        self());
    pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(PolicyEvent.TYPE_PREFIX, UPDATER_GROUP, self()),
        self());
  }
}
origin: org.eclipse.ditto/ditto-services-amqpbridge-messaging

private ReconnectActor(final ActorRef connectionShardRegion, final ActorRef pubSubMediator) {
  this.connectionShardRegion = connectionShardRegion;
  final Config config = getContext().system().settings().config();
  snapshotThreshold = config.getLong(ConfigKeys.Reconnect.SNAPSHOT_THRESHOLD);
  if (snapshotThreshold < 0) {
    throw new ConfigurationException(String.format("Config setting '%s' must be positive, but is: %d.",
        ConfigKeys.Reconnect.SNAPSHOT_THRESHOLD, snapshotThreshold));
  }
  snapshotAdapter = new MongoReconnectSnapshotAdapter(getContext().system());
  connectionIds = new HashSet<>();
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ConnectionCreated.TYPE, ACTOR_NAME, getSelf()),
      getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ConnectionOpened.TYPE, ACTOR_NAME, getSelf()),
      getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ConnectionClosed.TYPE, ACTOR_NAME, getSelf()),
      getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(ConnectionDeleted.TYPE, ACTOR_NAME, getSelf()),
      getSelf());
}
origin: ks-no/eventstore2

@Override
public void preStart() {
  registerSagas();
  try {
    ActorRef mediator =
        DistributedPubSub.get(getContext().system()).mediator();
    mediator.tell(new DistributedPubSubMediator.Subscribe(EventStore.EVENTSTOREMESSAGES, getSelf()),
        getSelf());
  } catch (ConfigurationException e){
    log.info("Not subscribing to eventstore event, no cluster system");
  }
  repository.open();
  subscribe();
  timeoutstore = getContext().actorOf(TimeOutStore.mkProps(repository));
}
origin: eclipse/ditto

private DistributedPubSubMediator.Subscribe subscribe(final String topic, final String group) {
  return new DistributedPubSubMediator.Subscribe(topic, group, getSelf());
}
origin: eclipse/ditto

private void subscribePubSub(final ActorRef pubSubMediator) {
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(Shutdown.TYPE, self), self);
}
origin: eclipse/ditto

private void subscribeForNamespaceCommands() {
  final ActorRef self = getSelf();
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(PurgeNamespace.TYPE, self), self);
}
origin: ks-no/eventstore2

@Override
public void preStart() {
  log.debug(getSelf().path().toString());
  try {
    ActorRef mediator =
        DistributedPubSub.get(getContext().system()).mediator();
    mediator.tell(new DistributedPubSubMediator.Subscribe(EventStore.EVENTSTOREMESSAGES, getSelf()),
        getSelf());
  } catch (ConfigurationException e){
    log.info("Not subscribing to eventstore event, no cluster system");
  }
  subscribe();
}
origin: eclipse/ditto

private void subscribeToDevopsTopic(final ActorRef pubSubMediator, final String topic,
    final String serviceName, final String instance) {
  pubSubMediator.tell(new Subscribe(topic, getSelf()), getSelf());
  pubSubMediator.tell(new Subscribe(
      String.join(":", topic, serviceName), getSelf()), getSelf());
  pubSubMediator.tell(new Subscribe(
      String.join(":", topic, serviceName, instance), getSelf()), getSelf());
}
origin: at.researchstudio.sat/won-matcher-service

@Override
public void preStart() {
 // subscribe for load need events
 pubSubMediator = DistributedPubSub.get(getContext().system()).mediator();
 pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(LoadNeedEvent.class.getName(), getSelf()), getSelf());
}
origin: org.eclipse.ditto/ditto-services-utils-devops

private void subscribeToDevopsTopic(final ActorRef pubSubMediator, final String topic,
    final String serviceName, final String instance) {
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(topic, getSelf()), getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(
      String.join(":", topic, serviceName), getSelf()), getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(
      String.join(":", topic, serviceName, instance), getSelf()), getSelf());
}
origin: at.researchstudio.sat/won-matcher-service

@Override
public void preStart() {
 // Subscribe for need events
 pubSubMediator = DistributedPubSub.get(getContext().system()).mediator();
 pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(NeedEvent.class.getName(), getSelf()), getSelf());
}
origin: eclipse/ditto

private BlockedNamespacesUpdater(final BlockedNamespaces blockedNamespaces, final ActorRef pubSubMediator) {
  this.blockedNamespaces = blockedNamespaces;
  // register self for pub-sub on restart
  pubSubMediator.tell(new Put(getSelf()), getSelf());
  // subscribe to namespace-blocking commands
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(BlockNamespace.TYPE, getSelf()), getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(UnblockNamespace.TYPE, getSelf()), getSelf());
}
origin: eclipse/ditto

@Override
public void preStart() {
  pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf());
  pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(BatchExecutionFinished.TYPE, ACTOR_NAME, getSelf()),
      getSelf());
}
origin: apache/usergrid

public ReservationCacheActor() {
  // subscribe to the topic named "content"
  ActorRef mediator = DistributedPubSub.get(getContext().system()).mediator();
  mediator.tell(new DistributedPubSubMediator.Subscribe("content", getSelf()), getSelf());
}
akka.cluster.pubsubDistributedPubSubMediator$Subscribe<init>

Popular methods of DistributedPubSubMediator$Subscribe

  • topic
  • group

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now