Search in sources :

Example 1 with PubSubInboundChannelAdapter

use of org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter in project spring-cloud-gcp by spring-cloud.

the class PubSubMessageChannelBinder method createConsumerEndpoint.

@Override
protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group, ExtendedConsumerProperties<PubSubConsumerProperties> properties) {
    PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(this.pubSubTemplate, destination.getName());
    ErrorInfrastructure errorInfrastructure = registerErrorInfrastructure(destination, group, properties);
    adapter.setErrorChannel(errorInfrastructure.getErrorChannel());
    adapter.setAckMode(properties.getExtension().getAckMode());
    return adapter;
}
Also used : PubSubInboundChannelAdapter(org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter)

Example 2 with PubSubInboundChannelAdapter

use of org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter in project spring-cloud-gcp by spring-cloud.

the class ReceiverApplication method messageChannelAdapter.

@Bean
public PubSubInboundChannelAdapter messageChannelAdapter(@Qualifier("pubsubInputChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
    PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, "exampleSubscription");
    adapter.setOutputChannel(inputChannel);
    adapter.setAckMode(AckMode.MANUAL);
    adapter.setPayloadType(String.class);
    return adapter;
}
Also used : PubSubInboundChannelAdapter(org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter) Bean(org.springframework.context.annotation.Bean)

Example 3 with PubSubInboundChannelAdapter

use of org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter in project spring-cloud-gcp by spring-cloud.

the class ReceiverApplication method messageChannelAdapter.

@Bean
public PubSubInboundChannelAdapter messageChannelAdapter(@Qualifier("pubsubInputChannel") MessageChannel inputChannel, PubSubOperations pubSubTemplate) {
    PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, "exampleSubscription");
    adapter.setOutputChannel(inputChannel);
    adapter.setAckMode(AckMode.MANUAL);
    return adapter;
}
Also used : PubSubInboundChannelAdapter(org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter) Bean(org.springframework.context.annotation.Bean)

Example 4 with PubSubInboundChannelAdapter

use of org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter in project spring-cloud-gcp by spring-cloud.

the class ReceiverConfiguration method messageChannelAdapter.

@Bean
public PubSubInboundChannelAdapter messageChannelAdapter(@Qualifier("pubSubInputChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
    PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, SUBSCRIPTION_NAME);
    adapter.setOutputChannel(inputChannel);
    adapter.setAckMode(AckMode.MANUAL);
    adapter.setPayloadType(Person.class);
    return adapter;
}
Also used : PubSubInboundChannelAdapter(org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter) Bean(org.springframework.context.annotation.Bean)

Aggregations

PubSubInboundChannelAdapter (org.springframework.cloud.gcp.pubsub.integration.inbound.PubSubInboundChannelAdapter)4 Bean (org.springframework.context.annotation.Bean)3