@Configuration public class PubSubConfiguration extends Object
Constructor and Description |
---|
PubSubConfiguration() |
Modifier and Type | Method and Description |
---|---|
List<com.yahoo.bullet.pubsub.Publisher> |
publishers(com.yahoo.bullet.pubsub.PubSub pubSub,
int publishers)
Creates the specified number of
Publisher instances from the given PubSub. |
com.yahoo.bullet.pubsub.PubSub |
pubSub(com.yahoo.bullet.common.BulletConfig pubSubConfig)
Creates a PubSub instance from a provided config.
|
com.yahoo.bullet.common.BulletConfig |
pubSubConfig(String config)
Creates a
BulletConfig from a file path. |
com.yahoo.bullet.pubsub.PubSubMessageSerDe |
pubSubMessageSendSerDe(com.yahoo.bullet.common.BulletConfig pubSubConfig)
Creates a
PubSubMessageSerDe from a given BulletConfig to use for sending messages to the PubSub. |
QueryService |
queryService(com.yahoo.bullet.storage.StorageManager<com.yahoo.bullet.pubsub.PubSubMessage> queryStorageManager,
HandlerService handlerService,
AsyncConfiguration.ResponderClasses responderClasses,
List<com.yahoo.bullet.pubsub.Publisher> publishers,
List<com.yahoo.bullet.pubsub.Subscriber> subscribers,
com.yahoo.bullet.pubsub.PubSubMessageSerDe pubSubMessageSendSerDe,
int sleep)
Creates a
QueryService instance from various necessary components. |
AsyncConfiguration.ResponderClasses |
responderClasses() |
List<com.yahoo.bullet.pubsub.Subscriber> |
subscribers(com.yahoo.bullet.pubsub.PubSub pubSub,
int subscribers)
Creates the specified number of
Subscriber instances from the given PubSub. |
@Bean @ConditionalOnMissingBean public AsyncConfiguration.ResponderClasses responderClasses()
@Bean public QueryService queryService(com.yahoo.bullet.storage.StorageManager<com.yahoo.bullet.pubsub.PubSubMessage> queryStorageManager, HandlerService handlerService, AsyncConfiguration.ResponderClasses responderClasses, List<com.yahoo.bullet.pubsub.Publisher> publishers, List<com.yahoo.bullet.pubsub.Subscriber> subscribers, com.yahoo.bullet.pubsub.PubSubMessageSerDe pubSubMessageSendSerDe, @Value(value="${bullet.pubsub.sleep-ms}") int sleep)
QueryService
instance from various necessary components.queryStorageManager
- The non-null StorageManager
to use.handlerService
- The HandlerService
to use.responderClasses
- The responders to use for asynchronous queries. May be empty.publishers
- The non-empty List
of Publisher
to use.subscribers
- The non-empty List
of Subscriber
to use.pubSubMessageSendSerDe
- The PubSubMessageSerDe
to use.sleep
- The time to sleep between checking for messages from the pubsub.QueryService
instance.@Bean public com.yahoo.bullet.common.BulletConfig pubSubConfig(@Value(value="${bullet.pubsub.config}") String config)
BulletConfig
from a file path.config
- The path to the settings file.BulletConfig
.@Bean public com.yahoo.bullet.pubsub.PubSub pubSub(com.yahoo.bullet.common.BulletConfig pubSubConfig) throws com.yahoo.bullet.pubsub.PubSubException
pubSubConfig
- The BulletConfig
containing settings for configuring the PubSub.PubSub
indicated in the config.com.yahoo.bullet.pubsub.PubSubException
- if there were issues creating the PubSub instance.@Bean public List<com.yahoo.bullet.pubsub.Publisher> publishers(com.yahoo.bullet.pubsub.PubSub pubSub, @Value(value="${bullet.pubsub.publishers}") int publishers) throws com.yahoo.bullet.pubsub.PubSubException
Publisher
instances from the given PubSub.pubSub
- The PubSub
providing the instances.publishers
- The number of publishers to create using PubSub.getPublishers(int)
.List
of Publisher
provided by the PubSub
instance.com.yahoo.bullet.pubsub.PubSubException
- if there were issues creating the instances.@Bean public List<com.yahoo.bullet.pubsub.Subscriber> subscribers(com.yahoo.bullet.pubsub.PubSub pubSub, @Value(value="${bullet.pubsub.subscribers}") int subscribers) throws com.yahoo.bullet.pubsub.PubSubException
Subscriber
instances from the given PubSub.pubSub
- The PubSub
providing the instances.subscribers
- The number of subscribers to create using PubSub.getSubscribers(int)
.List
of Subscriber
provided by the PubSub
instance.com.yahoo.bullet.pubsub.PubSubException
- if there were issues creating the instances.@Bean public com.yahoo.bullet.pubsub.PubSubMessageSerDe pubSubMessageSendSerDe(com.yahoo.bullet.common.BulletConfig pubSubConfig)
PubSubMessageSerDe
from a given BulletConfig
to use for sending messages to the PubSub.pubSubConfig
- The BulletConfig
containing relevant settings for the PubSubMessageSerDe
.PubSubMessageSerDe
.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.