org.springframework.integration.channel.PublishSubscribeChannel Java Examples

The following examples show how to use org.springframework.integration.channel.PublishSubscribeChannel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractMessageChannelBinder.java    From spring-cloud-stream with Apache License 2.0 5 votes vote down vote up
private boolean isSubscribable(SubscribableChannel errorChannel) {
	if (errorChannel instanceof PublishSubscribeChannel) {
		return true;
	}
	return errorChannel instanceof AbstractSubscribableChannel
			? ((AbstractSubscribableChannel) errorChannel).getSubscriberCount() == 0
			: true;
}
 
Example #2
Source File: TestChannelBinderProvisioner.java    From spring-cloud-stream with Apache License 2.0 5 votes vote down vote up
private SubscribableChannel provisionDestination(String name, boolean pubSub) {
	String destinationName = name + ".destination";
	SubscribableChannel destination = this.provisionedDestinations
			.get(destinationName);
	if (destination == null) {
		destination = pubSub ? new PublishSubscribeChannel() : new DirectChannel();
		((AbstractMessageChannel) destination).setBeanName(destinationName);
		((AbstractMessageChannel) destination).setComponentName(destinationName);
		this.provisionedDestinations.put(destinationName, destination);
	}
	return destination;
}
 
Example #3
Source File: SpringIntegrationConfig.java    From bearchoke with Apache License 2.0 5 votes vote down vote up
/**
     * SubscribableChannel for Axon CQRS to use
     * @return
     */
    @Bean(name = "defaultInputChannel")
    public PublishSubscribeChannel defaultInputChannel() {
        PublishSubscribeChannel channel = new PublishSubscribeChannel();
        List<ChannelInterceptor> list = new ArrayList<>(1);
        list.add(messageSelectingInterceptor());
        channel.setInterceptors(list);

//        channel.setDatatypes(Object.class); // we've defined it using the PayloadTypeSelector instead and injected it as an interceptor above
        return channel;
    }
 
Example #4
Source File: SpringIntegrationConfig.java    From bearchoke with Apache License 2.0 5 votes vote down vote up
/**
 * This channel can be used to monitor messages from our main channel without interrupting it.
 * @return
 */
@Bean(name = "monitoringChannel")
public PublishSubscribeChannel monitoringChannel() {
    PublishSubscribeChannel channel = new PublishSubscribeChannel();
    List<ChannelInterceptor> list = new ArrayList<>(1);
    list.add(wireTap());
    channel.setInterceptors(list);

    return channel;
}
 
Example #5
Source File: KinesisBinderProcessorTests.java    From spring-cloud-stream-binder-aws-kinesis with Apache License 2.0 4 votes vote down vote up
@Bean(name = Processor.INPUT + "." + CONSUMER_GROUP + ".errors")
public SubscribableChannel consumerErrorChannel() {
	return new PublishSubscribeChannel();
}
 
Example #6
Source File: PubSubChannelAdaptersIntegrationTests.java    From spring-cloud-gcp with Apache License 2.0 4 votes vote down vote up
@Bean
public MessageChannel outputChannel() {
	return new PublishSubscribeChannel();
}
 
Example #7
Source File: SecurityPubSubChannel.java    From tutorials with MIT License 4 votes vote down vote up
@Bean(name = "startPSChannel")
@SecuredChannel(interceptor = "channelSecurityInterceptor", sendAccess = "ROLE_VIEWER")
public PublishSubscribeChannel startChannel() {
    return new PublishSubscribeChannel(executor());
}