Expose MessageProducerSpec.role(String) option
Related to: https://stackoverflow.com/questions/78294542/role-in-integrationflow-dsl
(cherry picked from commit fd81adff27)
This commit is contained in:
committed by
Spring Builds
parent
6c4f7c0822
commit
a25b0a8691
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -70,6 +70,20 @@ public abstract class MessageProducerSpec<S extends MessageProducerSpec<S, P>, P
|
||||
return _this();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify the role for the endpoint.
|
||||
* Such endpoints can be started/stopped as a group.
|
||||
* @param role the role for this endpoint.
|
||||
* @return the endpoint spec
|
||||
* @see org.springframework.context.SmartLifecycle
|
||||
* @see org.springframework.integration.support.SmartLifecycleRoleController
|
||||
* @since 6.1.8
|
||||
*/
|
||||
public S role(String role) {
|
||||
this.target.setRole(role);
|
||||
return _this();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify the {@code outputChannel} for the
|
||||
* {@link org.springframework.integration.core.MessageProducer}.
|
||||
|
||||
@@ -522,6 +522,7 @@ public class JmsTests extends ActiveMQMultiContextTests {
|
||||
public IntegrationFlow jmsMessageDrivenRedeliveryFlow() {
|
||||
return IntegrationFlow
|
||||
.from(Jms.messageDrivenChannelAdapter(amqFactory)
|
||||
.role("someRole")
|
||||
.errorChannel("errorChannelForRedelivery")
|
||||
.destination("jmsMessageDrivenRedelivery")
|
||||
.configureListenerContainer(c -> c
|
||||
|
||||
Reference in New Issue
Block a user