public interface SubscriberFactory
PubSubTemplate
to create
supporting objects for consuming messages from Pub/Sub subscriptions.Modifier and Type | Method and Description |
---|---|
com.google.pubsub.v1.PullRequest |
createPullRequest(String subscriptionName,
Integer maxMessages,
Boolean returnImmediately)
Create a
PullRequest for synchronously pulling a number of messages from
a Google Cloud Pub/Sub subscription. |
Subscriber |
createSubscriber(String subscriptionName,
MessageReceiver receiver)
Create a
Subscriber for the specified subscription name and wired it up to
asynchronously deliver messages to the provided MessageReceiver . |
SubscriberStub |
createSubscriberStub()
Deprecated.
Use the new
createSubscriberStub(subscriptionName) instead. |
SubscriberStub |
createSubscriberStub(String subscriptionName)
Create a
SubscriberStub that is needed to execute PullRequest s. |
String |
getProjectId()
Method to get the project id.
|
String getProjectId()
Subscriber createSubscriber(String subscriptionName, MessageReceiver receiver)
Subscriber
for the specified subscription name and wired it up to
asynchronously deliver messages to the provided MessageReceiver
.subscriptionName
- the name of the subscriptionreceiver
- the callback for receiving messages asynchronouslySubscriber
that was created to bind the receiver to the subscriptioncom.google.pubsub.v1.PullRequest createPullRequest(String subscriptionName, Integer maxMessages, Boolean returnImmediately)
PullRequest
for synchronously pulling a number of messages from
a Google Cloud Pub/Sub subscription.subscriptionName
- the name of the subscriptionmaxMessages
- the maximum number of pulled messages; must be greater than zero.
If null is passed in, then up to Integer.MAX_VALUE messages will be requested.returnImmediately
- causes the pull request to return immediately even
if subscription doesn't contain enough messages to satisfy maxMessages
.
Setting this parameter to true
is not recommended as it may result in long delays in message delivery.SubscriberStub
@Deprecated SubscriberStub createSubscriberStub()
createSubscriberStub(subscriptionName)
instead.SubscriberStub
that is needed to execute PullRequest
s. This
method will only set global settings.SubscriberStub
used for executing PullRequest
s.SubscriberStub createSubscriberStub(String subscriptionName)
SubscriberStub
that is needed to execute PullRequest
s.subscriptionName
- the subscription nameSubscriberStub
used for executing PullRequest
sCopyright © 2021. All rights reserved.