Java Code Examples for org.springframework.integration.channel.PublishSubscribeChannel

The following examples show how to use org.springframework.integration.channel.PublishSubscribeChannel. These examples are extracted from open source projects. 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
private boolean isSubscribable(SubscribableChannel errorChannel) {
	if (errorChannel instanceof PublishSubscribeChannel) {
		return true;
	}
	return errorChannel instanceof AbstractSubscribableChannel
			? ((AbstractSubscribableChannel) errorChannel).getSubscriberCount() == 0
			: true;
}
 
Example 2
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 Project: bearchoke   Source File: SpringIntegrationConfig.java    License: 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 Project: bearchoke   Source File: SpringIntegrationConfig.java    License: 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
@Bean(name = Processor.INPUT + "." + CONSUMER_GROUP + ".errors")
public SubscribableChannel consumerErrorChannel() {
	return new PublishSubscribeChannel();
}
 
Example 6
@Bean
public MessageChannel outputChannel() {
	return new PublishSubscribeChannel();
}
 
Example 7
Source Project: tutorials   Source File: SecurityPubSubChannel.java    License: MIT License 4 votes vote down vote up
@Bean(name = "startPSChannel")
@SecuredChannel(interceptor = "channelSecurityInterceptor", sendAccess = "ROLE_VIEWER")
public PublishSubscribeChannel startChannel() {
    return new PublishSubscribeChannel(executor());
}