Class PubSubMessageSource
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<T>
org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>
com.google.cloud.spring.pubsub.integration.inbound.PubSubMessageSource
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.integration.core.MessageSource<Object>
,org.springframework.integration.IntegrationPattern
,org.springframework.integration.support.context.NamedComponent
,org.springframework.integration.support.management.IntegrationInboundManagement
,org.springframework.integration.support.management.IntegrationManagement
,org.springframework.integration.support.management.MessageSourceManagement
public class PubSubMessageSource
extends org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>
A PubSub
Synchronous pull implementation of
AbstractMessageSource
.- Since:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
-
Constructor Summary
ConstructorDescriptionPubSubMessageSource
(PubSubSubscriberOperations pubSubSubscriberOperations, String subscriptionName) Instantiates a Pub/Sub inbound message adapter to poll a given subscription for messages. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
doReceive
(int fetchSize) Provides a single polled message.void
setAckMode
(AckMode ackMode) void
setBlockOnPull
(boolean blockOnPull) Instructs synchronous pull to wait until at least one message is available.void
setHeaderMapper
(org.springframework.integration.mapping.HeaderMapper<Map<String, String>> headerMapper) void
setPayloadType
(Class<?> payloadType) Methods inherited from class org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource
doReceive, getMaxFetchSize, setMaxFetchSize
Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType
Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs, isObserved, registerObservationRegistry
Methods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternType
-
Constructor Details
-
PubSubMessageSource
public PubSubMessageSource(PubSubSubscriberOperations pubSubSubscriberOperations, String subscriptionName) Instantiates a Pub/Sub inbound message adapter to poll a given subscription for messages.- Parameters:
pubSubSubscriberOperations
-PubSubSubscriberOperations
to usesubscriptionName
- short or fully qualified subscription name
-
-
Method Details
-
setAckMode
-
setPayloadType
-
setHeaderMapper
-
setBlockOnPull
public void setBlockOnPull(boolean blockOnPull) Instructs synchronous pull to wait until at least one message is available.- Parameters:
blockOnPull
- whether to block until a message is available
-
doReceive
Provides a single polled message.Messages are received from Pub/Sub by synchronous pull, in batches determined by
fetchSize
.- Specified by:
doReceive
in classorg.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>
- Parameters:
fetchSize
- number of messages to fetch from Pub/Sub.- Returns:
Message
wrapper containing the original message.
-
getComponentType
-