diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AbstractMessageListenerContainerSpec.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AbstractMessageListenerContainerSpec.java index 7f4c971e4cc..9d2050487ce 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AbstractMessageListenerContainerSpec.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AbstractMessageListenerContainerSpec.java @@ -20,7 +20,6 @@ import java.util.concurrent.Executor; import org.aopalliance.aop.Advice; -import org.jspecify.annotations.Nullable; import org.springframework.amqp.core.AcknowledgeMode; import org.springframework.amqp.core.MessagePostProcessor; @@ -56,7 +55,7 @@ public AbstractMessageListenerContainerSpec(C listenerContainer) { } @Override - public S id(@Nullable String id) { // NOSONAR - not useless, increases visibility + public S id(String id) { return super.id(id); } diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/Amqp.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/Amqp.java index 1c281777ba8..3ccc08a46a1 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/Amqp.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/Amqp.java @@ -16,8 +16,6 @@ package org.springframework.integration.amqp.dsl; -import org.jspecify.annotations.Nullable; - import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.Queue; import org.springframework.amqp.rabbit.AsyncRabbitTemplate; @@ -274,7 +272,7 @@ public static AmqpAsyncOutboundGatewaySpec asyncOutboundGateway(AsyncRabbitTempl public static AmqpPollableMessageChannelSpec pollableChannel( ConnectionFactory connectionFactory) { - return pollableChannel(null, connectionFactory); + return new AmqpPollableMessageChannelSpec<>(connectionFactory); } /** @@ -283,7 +281,7 @@ public static AmqpPollableMessageChannelSpec pollableCha * @param connectionFactory the connectionFactory. * @return the AmqpPollableMessageChannelSpec. */ - public static AmqpPollableMessageChannelSpec pollableChannel(@Nullable String id, + public static AmqpPollableMessageChannelSpec pollableChannel(String id, ConnectionFactory connectionFactory) { AmqpPollableMessageChannelSpec spec = @@ -297,7 +295,7 @@ public static AmqpPollableMessageChannelSpec pollableCha * @return the AmqpMessageChannelSpec. */ public static AmqpMessageChannelSpec channel(ConnectionFactory connectionFactory) { - return channel(null, connectionFactory); + return new AmqpMessageChannelSpec<>(connectionFactory); } /** @@ -306,7 +304,7 @@ public static AmqpPollableMessageChannelSpec pollableCha * @param connectionFactory the connectionFactory. * @return the AmqpMessageChannelSpec. */ - public static AmqpMessageChannelSpec channel(@Nullable String id, ConnectionFactory connectionFactory) { + public static AmqpMessageChannelSpec channel(String id, ConnectionFactory connectionFactory) { return new AmqpMessageChannelSpec<>(connectionFactory) .id(id); } @@ -317,7 +315,7 @@ public static AmqpPollableMessageChannelSpec pollableCha * @return the AmqpPublishSubscribeMessageChannelSpec. */ public static AmqpPublishSubscribeMessageChannelSpec publishSubscribeChannel(ConnectionFactory connectionFactory) { - return publishSubscribeChannel(null, connectionFactory); + return new AmqpPublishSubscribeMessageChannelSpec(connectionFactory); } /** @@ -326,7 +324,7 @@ public static AmqpPublishSubscribeMessageChannelSpec publishSubscribeChannel(Con * @param connectionFactory the connectionFactory. * @return the AmqpPublishSubscribeMessageChannelSpec. */ - public static AmqpPublishSubscribeMessageChannelSpec publishSubscribeChannel(@Nullable String id, + public static AmqpPublishSubscribeMessageChannelSpec publishSubscribeChannel(String id, ConnectionFactory connectionFactory) { return new AmqpPublishSubscribeMessageChannelSpec(connectionFactory).id(id); diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpPollableMessageChannelSpec.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpPollableMessageChannelSpec.java index fb0316b9b2a..54fd2dc1ac8 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpPollableMessageChannelSpec.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/dsl/AmqpPollableMessageChannelSpec.java @@ -16,8 +16,6 @@ package org.springframework.integration.amqp.dsl; -import org.jspecify.annotations.Nullable; - import org.springframework.amqp.core.MessageDeliveryMode; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.support.MessagePropertiesConverter; @@ -29,7 +27,6 @@ import org.springframework.integration.amqp.support.AmqpHeaderMapper; import org.springframework.integration.dsl.MessageChannelSpec; import org.springframework.util.Assert; -import org.springframework.util.StringUtils; /** * A {@link MessageChannelSpec} for a {@link AbstractAmqpChannel}s. @@ -66,10 +63,8 @@ protected AmqpPollableMessageChannelSpec(ConnectionFactory connectionFactory) { } @Override - protected S id(@Nullable String id) { - if (StringUtils.hasText(id)) { - this.amqpChannelFactoryBean.setBeanName(id); - } + protected S id(String id) { + this.amqpChannelFactoryBean.setBeanName(id); return super.id(id); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java index c1912aaed5b..8966ada3a25 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/AggregatorSpec.java @@ -40,7 +40,7 @@ */ public class AggregatorSpec extends CorrelationHandlerSpec { - private Function> headersFunction; + private @Nullable Function> headersFunction; protected AggregatorSpec() { super(new AggregatingMessageHandler(new DefaultAggregatingMessageGroupProcessor())); @@ -123,7 +123,7 @@ public AggregatorSpec headersFunction(Function } @Override - public Map getComponentsToRegister() { + public Map getComponentsToRegister() { if (this.headersFunction != null) { MessageGroupProcessor outputProcessor = this.handler.getOutputProcessor(); if (outputProcessor instanceof AbstractAggregatingMessageGroupProcessor abstractAggregatingMessageGroupProcessor) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BarrierSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BarrierSpec.java index 82677dd578b..35316736220 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BarrierSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BarrierSpec.java @@ -45,17 +45,13 @@ public class BarrierSpec extends ConsumerEndpointSpec integrationComponents = new LinkedHashMap<>(); //NOSONAR - final + protected final Map integrationComponents = new LinkedHashMap<>(); //NOSONAR - final - private MessageChannel currentMessageChannel; + private @Nullable MessageChannel currentMessageChannel; - private Object currentComponent; + private @Nullable Object currentComponent; private boolean implicitChannel; - private StandardIntegrationFlow integrationFlow; + private @Nullable StandardIntegrationFlow integrationFlow; protected BaseIntegrationFlowDefinition() { } @@ -152,14 +151,14 @@ protected B addComponent(Object component, @Nullable String beanName) { return _this(); } - protected B addComponents(Map components) { + protected B addComponents(Map components) { if (!CollectionUtils.isEmpty(components)) { this.integrationComponents.putAll(components); } return _this(); } - protected Map getIntegrationComponents() { + protected Map getIntegrationComponents() { return this.integrationComponents; } @@ -168,8 +167,7 @@ protected B currentComponent(@Nullable Object component) { return _this(); } - @Nullable - protected Object getCurrentComponent() { + protected @Nullable Object getCurrentComponent() { return this.currentComponent; } @@ -178,8 +176,7 @@ protected B currentMessageChannel(@Nullable MessageChannel currentMessageChannel return _this(); } - @Nullable - protected MessageChannel getCurrentMessageChannel() { + protected @Nullable MessageChannel getCurrentMessageChannel() { return this.currentMessageChannel; } @@ -1591,7 +1588,7 @@ public B resequence(@Nullable Consumer resequencer) { * @return the current {@link BaseIntegrationFlowDefinition}. */ public B aggregate() { - return aggregate((Consumer) null); + return aggregate(null); } /** @@ -1829,8 +1826,8 @@ protected componentsToRegister = null; - Map routerComponents = routerSpec.getComponentsToRegister(); + Map componentsToRegister = null; + Map routerComponents = routerSpec.getComponentsToRegister(); if (!CollectionUtils.isEmpty(routerComponents)) { componentsToRegister = new LinkedHashMap<>(routerComponents); routerComponents.clear(); @@ -2571,7 +2568,7 @@ protected Publisher> toReactivePublisher() { protected Publisher> toReactivePublisher(boolean autoStartOnSubscribe) { MessageChannel channelForPublisher = getCurrentMessageChannel(); Publisher> publisher; - Map components = getIntegrationComponents(); + Map components = getIntegrationComponents(); if (channelForPublisher instanceof Publisher) { publisher = (Publisher>) channelForPublisher; } @@ -2700,7 +2697,7 @@ protected StandardIntegrationFlow get() { "EIP-method in the 'IntegrationFlow' definition."); } - Map components = getIntegrationComponents(); + Map components = getIntegrationComponents(); if (components.size() == 1) { Object currComponent = getCurrentComponent(); if (currComponent != null) { @@ -2736,17 +2733,8 @@ protected void checkReuse(MessageProducer replyHandler) { REFERENCED_REPLY_PRODUCERS.add(replyHandler); } - @Nullable - protected static Object extractProxyTarget(@Nullable Object target) { - if (!(target instanceof Advised advised)) { - return target; - } - try { - return extractProxyTarget(advised.getTargetSource().getTarget()); - } - catch (Exception e) { - throw new BeanCreationException("Could not extract target", e); - } + protected static @Nullable Object extractProxyTarget(@Nullable Object target) { + return IntegrationFlow.extractProxyTarget(target); } public static final class ReplyProducerCleaner implements DestructionAwareBeanPostProcessor, AopInfrastructureBean { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BroadcastPublishSubscribeSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BroadcastPublishSubscribeSpec.java index c90204e209e..f64e09d118a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BroadcastPublishSubscribeSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BroadcastPublishSubscribeSpec.java @@ -19,6 +19,8 @@ import java.util.LinkedHashMap; import java.util.Map; +import org.jspecify.annotations.Nullable; + import org.springframework.integration.channel.BroadcastCapableChannel; import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; @@ -36,7 +38,7 @@ public class BroadcastPublishSubscribeSpec extends IntegrationComponentSpec implements ComponentsRegistration { - private final Map subscriberFlows = new LinkedHashMap<>(); + private final Map subscriberFlows = new LinkedHashMap<>(); private int order; @@ -74,7 +76,7 @@ public BroadcastPublishSubscribeSpec subscribe(IntegrationFlow subFlow) { } @Override - public Map getComponentsToRegister() { + public Map getComponentsToRegister() { return this.subscriberFlows; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java index 5e0197b63fb..ab520287bad 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java @@ -74,10 +74,13 @@ public abstract class ConsumerEndpointSpec, @Nullable private Boolean async; - @Nullable - private String[] notPropagatedHeaders; + private String @Nullable [] notPropagatedHeaders; + + protected ConsumerEndpointSpec() { + super(new ConsumerEndpointFactoryBean()); + } - protected ConsumerEndpointSpec(@Nullable H messageHandler) { + protected ConsumerEndpointSpec(H messageHandler) { super(messageHandler, new ConsumerEndpointFactoryBean()); } @@ -373,6 +376,7 @@ protected Tuple2 doGet() { .acceptIfNotEmpty(this.adviceChain, producingMessageHandler::setAdviceChain); } + Assert.state(this.handler != null, "'this.handler' must not be null."); this.endpointFactoryBean.setHandler(this.handler); return super.doGet(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/EndpointSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/EndpointSpec.java index 85bc921966c..aa90c71f161 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/EndpointSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/EndpointSpec.java @@ -49,22 +49,25 @@ public abstract class EndpointSpec, F extends Be extends IntegrationComponentSpec> implements ComponentsRegistration { - protected final Map componentsToRegister = new LinkedHashMap<>(); // NOSONAR final + protected final Map componentsToRegister = new LinkedHashMap<>(); // NOSONAR final protected final F endpointFactoryBean; // NOSONAR final - protected H handler; // NOSONAR + @SuppressWarnings("NullAway.Init") + protected H handler; - protected EndpointSpec(@Nullable H handler, F endpointFactoryBean) { + protected EndpointSpec(F endpointFactoryBean) { + this.endpointFactoryBean = endpointFactoryBean; + } + + protected EndpointSpec(H handler, F endpointFactoryBean) { this.endpointFactoryBean = endpointFactoryBean; this.handler = handler; } @Override - public S id(@Nullable String id) { - if (id != null) { - this.endpointFactoryBean.setBeanName(id); - } + public S id(String id) { + this.endpointFactoryBean.setBeanName(id); return super.id(id); } @@ -85,7 +88,7 @@ public S poller(Function pollers) { * @see PollerSpec */ public S poller(PollerSpec pollerMetadataSpec) { - Map components = pollerMetadataSpec.getComponentsToRegister(); + Map components = pollerMetadataSpec.getComponentsToRegister(); this.componentsToRegister.putAll(components); return poller(pollerMetadataSpec.getObject()); } @@ -122,17 +125,14 @@ public S poller(PollerSpec pollerMetadataSpec) { public abstract S role(String role); @Override - public Map getComponentsToRegister() { + public Map getComponentsToRegister() { return this.componentsToRegister; } @Override protected Tuple2 doGet() { - return Tuples.of(this.endpointFactoryBean, this.handler); - } - - protected void assertHandler() { Assert.state(this.handler != null, "'this.handler' must not be null."); + return Tuples.of(this.endpointFactoryBean, this.handler); } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/FilterEndpointSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/FilterEndpointSpec.java index fc0ca769d9e..433d96db1a7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/FilterEndpointSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/FilterEndpointSpec.java @@ -35,7 +35,7 @@ protected FilterEndpointSpec(MessageFilter messageFilter) { /** * The default value is false meaning that rejected * Messages will be quietly dropped or sent to the discard channel if - * available. Typically this value would not be true when + * available. Typically, this value would not be true when * a discard channel is provided, but if so, it will still apply * (in such a case, the Message will be sent to the discard channel, * and then the exception will be thrown). diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java index b5f7365cf8a..e71c94b9c47 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/HeaderEnricherSpec.java @@ -64,7 +64,6 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec getObjectType() { * !!! This method must not be called from the target configuration !!! * @return the object backed by this factory bean. */ - @NonNull @Override public T getObject() { - if (this.target == null) { - this.target = doGet(); + T targetToReturn = this.target; + if (targetToReturn == null) { + targetToReturn = doGet(); + this.target = targetToReturn; } - return this.target; + return targetToReturn; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlow.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlow.java index 85694b4aa2d..f6dde48282a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlow.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlow.java @@ -71,7 +71,6 @@ * .aggregate() * .channel(MessageChannels.queue("routerTwoSubFlowsOutput")); * } - * * *

* Also, this interface can be implemented directly to encapsulate the integration logic @@ -115,8 +114,7 @@ public interface IntegrationFlow { * @return the channel. * @since 5.0.4 */ - @Nullable - default MessageChannel getInputChannel() { + default @Nullable MessageChannel getInputChannel() { return null; } @@ -125,8 +123,8 @@ default MessageChannel getInputChannel() { * @return the map of integration components managed by this flow. * @since 5.5.4 */ - default Map getIntegrationComponents() { - return Collections.emptyMap(); + default Map getIntegrationComponents() { + return Collections.emptyMap(); } /** @@ -281,7 +279,7 @@ static IntegrationFlowBuilder from(MessageSource messageSource) { /** * Populate the provided {@link MessageSource} object to the {@link IntegrationFlowBuilder} chain. * The {@link IntegrationFlow} {@code startMessageSource}. - * In addition use {@link SourcePollingChannelAdapterSpec} to provide options for the underlying + * In addition, use {@link SourcePollingChannelAdapterSpec} to provide options for the underlying * {@link org.springframework.integration.endpoint.SourcePollingChannelAdapter} endpoint. * @param messageSource the {@link MessageSource} to populate. * @param endpointConfigurer the {@link Consumer} to provide more options for the @@ -441,7 +439,7 @@ static IntegrationFlowBuilder from(Publisher> publisher) { */ @SuppressWarnings("overloads") static IntegrationFlowBuilder from(IntegrationFlow other) { - Map integrationComponents = other.getIntegrationComponents(); + Map integrationComponents = other.getIntegrationComponents(); Assert.notEmpty(integrationComponents, () -> "The provided integration flow to compose from '" + other + "' must be declared as a bean in the application context"); @@ -499,9 +497,8 @@ private static IntegrationFlowBuilder registerComponents(Object spec) { return null; } - @Nullable @SuppressWarnings("unchecked") - private static T extractProxyTarget(@Nullable T target) { + static @Nullable T extractProxyTarget(@Nullable T target) { if (!(target instanceof Advised advised)) { return target; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowAdapter.java index f593865f1fa..f8908e30f8b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowAdapter.java @@ -36,7 +36,7 @@ /** * The base {@code Adapter} class for the {@link IntegrationFlow} abstraction. * Requires the implementation for the {@link #buildFlow()} method to produce - * {@link IntegrationFlowDefinition} using one of {@link #from} support methods. + * {@link IntegrationFlowDefinition} using one of {@code #from()} support methods. *

* Typically, is used for target service implementation: *

@@ -65,13 +65,15 @@ public abstract class IntegrationFlowAdapter
 
 	private final AtomicBoolean running = new AtomicBoolean();
 
+	@SuppressWarnings("NullAway.Init")
 	private StandardIntegrationFlow targetIntegrationFlow;
 
+	@SuppressWarnings("NullAway.Init")
 	private String beanName;
 
-	private Object beanSource;
+	private @Nullable Object beanSource;
 
-	private String beanDescription;
+	private @Nullable String beanDescription;
 
 	@Override
 	public void setBeanName(String name) {
@@ -128,7 +130,7 @@ public MessageChannel getInputChannel() {
 	}
 
 	@Override
-	public Map getIntegrationComponents() {
+	public Map getIntegrationComponents() {
 		return this.targetIntegrationFlow.getIntegrationComponents();
 	}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowExtension.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowExtension.java
index 6f1b13eb3ad..b314ab19932 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowExtension.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowExtension.java
@@ -18,6 +18,8 @@
 
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.channel.DirectChannel;
 
 /**
@@ -82,7 +84,9 @@ private static class StandardIntegrationFlowExtension extends StandardIntegratio
 
 		private final DirectChannel inputChannel;
 
-		StandardIntegrationFlowExtension(Map integrationComponents, DirectChannel inputChannel) {
+		StandardIntegrationFlowExtension(Map integrationComponents,
+				DirectChannel inputChannel) {
+
 			super(integrationComponents);
 			this.inputChannel = inputChannel;
 		}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/LoadBalancingChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/LoadBalancingChannelSpec.java
index 8029c6ef95c..51a30eeaa08 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/LoadBalancingChannelSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/LoadBalancingChannelSpec.java
@@ -18,6 +18,8 @@
 
 import java.util.function.Predicate;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.channel.AbstractMessageChannel;
 import org.springframework.integration.dispatcher.LoadBalancingStrategy;
 import org.springframework.integration.dispatcher.RoundRobinLoadBalancingStrategy;
@@ -36,9 +38,9 @@ public abstract class LoadBalancingChannelSpec failoverStrategy; // NOSONAR
+	protected @Nullable Predicate failoverStrategy; // NOSONAR
 
-	protected Integer maxSubscribers; // NOSONAR
+	protected @Nullable Integer maxSubscribers; // NOSONAR
 
 	protected LoadBalancingChannelSpec() {
 	}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannelSpec.java
index 2cf278bfb2b..ebdac79dd51 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannelSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannelSpec.java
@@ -23,6 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.channel.AbstractMessageChannel;
 import org.springframework.integration.channel.interceptor.WireTap;
 import org.springframework.messaging.MessageChannel;
@@ -43,15 +45,16 @@ public abstract class MessageChannelSpec, C e
 		extends IntegrationComponentSpec
 		implements ComponentsRegistration {
 
-	private final Map componentsToRegister = new LinkedHashMap<>();
+	private final Map componentsToRegister = new LinkedHashMap<>();
 
 	private final List> datatypes = new ArrayList<>();
 
 	private final List interceptors = new LinkedList<>();
 
-	protected C channel; // NOSONAR
+	@SuppressWarnings("NullAway.Init")
+	protected C channel;
 
-	private MessageConverter messageConverter;
+	private @Nullable MessageConverter messageConverter;
 
 	protected MessageChannelSpec() {
 	}
@@ -111,16 +114,20 @@ public S messageConverter(MessageConverter converter) {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
+	public Map getComponentsToRegister() {
 		return this.componentsToRegister;
 	}
 
 	@Override
 	protected C doGet() {
 		this.channel.setDatatypes(this.datatypes.toArray(new Class[0]));
-		this.channel.setBeanName(getId());
+		if (getId() != null) {
+			this.channel.setBeanName(getId());
+		}
 		this.channel.setInterceptors(this.interceptors);
-		this.channel.setMessageConverter(this.messageConverter);
+		if (this.messageConverter != null) {
+			this.channel.setMessageConverter(this.messageConverter);
+		}
 		return this.channel;
 	}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageProducerSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageProducerSpec.java
index 25d8d28a4a7..204bf241ff9 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageProducerSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageProducerSpec.java
@@ -16,8 +16,6 @@
 
 package org.springframework.integration.dsl;
 
-import org.jspecify.annotations.Nullable;
-
 import org.springframework.integration.endpoint.MessageProducerSupport;
 import org.springframework.integration.support.ErrorMessageStrategy;
 import org.springframework.integration.support.management.observation.MessageReceiverObservationConvention;
@@ -37,7 +35,10 @@
 public abstract class MessageProducerSpec, P extends MessageProducerSupport>
 		extends IntegrationComponentSpec {
 
-	public MessageProducerSpec(@Nullable P producer) {
+	public MessageProducerSpec() {
+	}
+
+	public MessageProducerSpec(P producer) {
 		this.target = producer;
 	}
 
@@ -46,7 +47,7 @@ public MessageProducerSpec(@Nullable P producer) {
 	 * Configure the message producer's bean name.
 	 */
 	@Override
-	public S id(@Nullable String id) {
+	public S id(String id) {
 		this.target.setBeanName(id);
 		return super.id(id);
 	}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessagingGatewaySpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessagingGatewaySpec.java
index f4b892f230a..f188be1324e 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessagingGatewaySpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/MessagingGatewaySpec.java
@@ -16,8 +16,6 @@
 
 package org.springframework.integration.dsl;
 
-import org.jspecify.annotations.Nullable;
-
 import org.springframework.integration.gateway.MessagingGatewaySupport;
 import org.springframework.integration.mapping.InboundMessageMapper;
 import org.springframework.integration.mapping.OutboundMessageMapper;
@@ -42,7 +40,7 @@ public MessagingGatewaySpec(G gateway) {
 	}
 
 	@Override
-	public S id(@Nullable String id) {
+	public S id(String id) {
 		this.target.setBeanName(id);
 		return super.id(id);
 	}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PartitionedChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PartitionedChannelSpec.java
index 48b50e8711b..300a71ca2e1 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PartitionedChannelSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PartitionedChannelSpec.java
@@ -35,11 +35,9 @@ public class PartitionedChannelSpec extends LoadBalancingChannelSpec, Object> partitionKeyFunction;
+	private @Nullable Function, Object> partitionKeyFunction;
 
-	@Nullable
-	private ThreadFactory threadFactory;
+	private @Nullable ThreadFactory threadFactory;
 
 	protected PartitionedChannelSpec(int partitionCount) {
 		this.partitionCount = partitionCount;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerSpec.java
index 3ebc505210b..76d301d85ef 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerSpec.java
@@ -24,6 +24,7 @@
 import java.util.concurrent.Executor;
 
 import org.aopalliance.aop.Advice;
+import org.jspecify.annotations.Nullable;
 
 import org.springframework.integration.channel.MessagePublishingErrorHandler;
 import org.springframework.integration.scheduling.PollerMetadata;
@@ -48,7 +49,7 @@ public final class PollerSpec extends IntegrationComponentSpec adviceChain = new LinkedList<>();
 
-	private final Map componentsToRegister = new LinkedHashMap<>();
+	private final Map componentsToRegister = new LinkedHashMap<>();
 
 	PollerSpec(Trigger trigger) {
 		this.target = new PollerMetadata();
@@ -190,7 +191,7 @@ public PollerSpec taskExecutor(Executor taskExecutor) {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
+	public Map getComponentsToRegister() {
 		return this.componentsToRegister;
 	}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PriorityChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PriorityChannelSpec.java
index 31f316eeae6..f584314844f 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PriorityChannelSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PriorityChannelSpec.java
@@ -18,6 +18,8 @@
 
 import java.util.Comparator;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.channel.PriorityChannel;
 import org.springframework.integration.store.MessageGroupQueue;
 import org.springframework.integration.store.PriorityCapableChannelMessageStore;
@@ -33,9 +35,9 @@ public class PriorityChannelSpec extends MessageChannelSpec> comparator;
+	private @Nullable Comparator> comparator;
 
-	private MessageGroupQueue messageGroupQueue;
+	private @Nullable MessageGroupQueue messageGroupQueue;
 
 	protected PriorityChannelSpec() {
 	}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeSpec.java
index fc63cc1065a..149ed31f8b4 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeSpec.java
@@ -45,7 +45,7 @@ protected PublishSubscribeSpec(@Nullable Executor executor) {
 	}
 
 	@Override
-	public PublishSubscribeSpec id(String id) { // NOSONAR - not useless, increases visibility
+	public PublishSubscribeSpec id(String id) {
 		return super.id(id);
 	}
 
@@ -55,8 +55,8 @@ public PublishSubscribeSpec subscribe(IntegrationFlow subFlow) {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
-		Map objects = new LinkedHashMap<>();
+	public Map getComponentsToRegister() {
+		Map objects = new LinkedHashMap<>();
 		objects.putAll(super.getComponentsToRegister());
 		objects.putAll(this.delegate.getComponentsToRegister());
 		return objects;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublisherIntegrationFlow.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublisherIntegrationFlow.java
index 6eae4874645..2907f9006fb 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublisherIntegrationFlow.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/PublisherIntegrationFlow.java
@@ -18,6 +18,7 @@
 
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
 import org.reactivestreams.Publisher;
 import org.reactivestreams.Subscriber;
 import reactor.core.publisher.Flux;
@@ -37,7 +38,7 @@ class PublisherIntegrationFlow extends StandardIntegrationFlow implements Pub
 
 	private final Publisher> delegate;
 
-	PublisherIntegrationFlow(Map integrationComponents, Publisher> publisher,
+	PublisherIntegrationFlow(Map integrationComponents, Publisher> publisher,
 			boolean autoStartOnSubscribe) {
 
 		super(integrationComponents);
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java
index d8a39adfa6c..e755d890813 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java
@@ -19,6 +19,8 @@
 import java.util.Queue;
 import java.util.concurrent.locks.Lock;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.channel.QueueChannel;
 import org.springframework.integration.store.ChannelMessageStore;
 import org.springframework.integration.store.MessageGroupQueue;
@@ -31,9 +33,9 @@
  */
 public class QueueChannelSpec extends MessageChannelSpec {
 
-	protected Queue> queue; // NOSONAR
+	protected @Nullable Queue> queue; // NOSONAR
 
-	protected Integer capacity; // NOSONAR
+	protected @Nullable Integer capacity; // NOSONAR
 
 	protected QueueChannelSpec() {
 	}
@@ -69,7 +71,7 @@ public static class MessageStoreSpec extends QueueChannelSpec {
 
 		private final Object groupId;
 
-		private Lock storeLock;
+		private @Nullable Lock storeLock;
 
 		protected MessageStoreSpec(ChannelMessageStore messageGroupStore, Object groupId) {
 			this.messageGroupStore = messageGroupStore;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/ReactiveMessageHandlerSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/ReactiveMessageHandlerSpec.java
index baad66a21f7..e1a4386842d 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/ReactiveMessageHandlerSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/ReactiveMessageHandlerSpec.java
@@ -19,6 +19,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.integration.handler.ReactiveMessageHandlerAdapter;
 import org.springframework.messaging.ReactiveMessageHandler;
 
@@ -44,8 +46,8 @@ protected ReactiveMessageHandlerSpec(H reactiveMessageHandler) {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
-		return Collections.singletonMap(this.reactiveMessageHandler, null);
+	public Map getComponentsToRegister() {
+		return Collections.singletonMap(this.reactiveMessageHandler, null);
 	}
 
 }
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java
index b2699027ec7..ba56ee051a5 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java
@@ -19,8 +19,9 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.core.convert.ConversionService;
-import org.springframework.core.convert.support.DefaultConversionService;
 import org.springframework.integration.context.IntegrationObjectSupport;
 import org.springframework.integration.router.AbstractMappingMessageRouter;
 import org.springframework.integration.router.AbstractMessageRouter;
@@ -46,9 +47,9 @@ public class RouterSpec extends Abstr
 
 	private final RouterMappingProvider mappingProvider;
 
-	private String prefix;
+	private @Nullable String prefix;
 
-	private String suffix;
+	private @Nullable String suffix;
 
 	private boolean mappingProviderRegistered;
 
@@ -225,7 +226,7 @@ public RouterSpec defaultOutputToParentFlow() {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
+	public Map getComponentsToRegister() {
 		// The 'mappingProvider' must be added to the 'componentsToRegister' in the end to
 		// let all other components to be registered before the 'RouterMappingProvider.onInit()' logic.
 		if (!this.mappingProviderRegistered) {
@@ -255,9 +256,6 @@ void addMapping(Object key, NamedComponent channel) {
 		protected void onInit() {
 			super.onInit();
 			ConversionService conversionService = getConversionService();
-			if (conversionService == null) {
-				conversionService = DefaultConversionService.getSharedInstance();
-			}
 			for (Map.Entry entry : this.mapping.entrySet()) {
 				Object key = entry.getKey();
 				String channelKey;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/SplitterSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/SplitterSpec.java
index e2572d97d40..2e6f0079a5a 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/SplitterSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/SplitterSpec.java
@@ -48,34 +48,27 @@ public class SplitterSpec extends ConsumerEndpointSpec function;
+	private @Nullable Function function;
 
-	@Nullable
-	private Class expectedType;
+	private @Nullable Class expectedType;
 
-	@Nullable
-	private String delimiters;
+	private @Nullable String delimiters;
 
-	@Nullable
-	private String discardChannelName;
+	private @Nullable String discardChannelName;
 
-	@Nullable
-	private MessageChannel discardChannel;
+	private @Nullable MessageChannel discardChannel;
 
-	@Nullable
-	private Boolean applySequence;
+	private @Nullable Boolean applySequence;
 
 	protected SplitterSpec() {
-		super(null);
 	}
 
 	/**
@@ -277,7 +270,7 @@ else if (this.refName != null) {
 			splitter = new MethodInvokingSplitter(new BeanNameMessageProcessor<>(this.refName, this.method));
 		}
 		else if (this.function != null) {
-			splitter = wrapFunctionToSplitter();
+			splitter = wrapFunctionToSplitter(this.function);
 		}
 
 		if (this.delimiters != null) {
@@ -299,10 +292,10 @@ else if (this.function != null) {
 		return super.doGet();
 	}
 
-	private MethodInvokingSplitter wrapFunctionToSplitter() {
-		return ClassUtils.isLambda(this.function)
-				? new MethodInvokingSplitter(new LambdaMessageProcessor(this.function, this.expectedType))
-				: new MethodInvokingSplitter(this.function, ClassUtils.FUNCTION_APPLY_METHOD);
+	private MethodInvokingSplitter wrapFunctionToSplitter(Function function) {
+		return ClassUtils.isLambda(function)
+				? new MethodInvokingSplitter(new LambdaMessageProcessor(function, this.expectedType))
+				: new MethodInvokingSplitter(function, ClassUtils.FUNCTION_APPLY_METHOD);
 	}
 
 }
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java
index afefb462e55..6f821279fd1 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java
@@ -72,19 +72,20 @@
 public class StandardIntegrationFlow
 		implements IntegrationFlow, SmartLifecycle, ComponentSourceAware, NamedComponent {
 
-	private final Map integrationComponents;
+	private final Map integrationComponents;
 
-	private MessageChannel inputChannel;
+	private @Nullable MessageChannel inputChannel;
 
-	private boolean running;
+	private @Nullable boolean running;
 
+	@SuppressWarnings("NullAway.Init")
 	private String beanName;
 
-	private Object beanSource;
+	private @Nullable Object beanSource;
 
-	private String beanDescription;
+	private @Nullable String beanDescription;
 
-	StandardIntegrationFlow(Map integrationComponents) {
+	StandardIntegrationFlow(Map integrationComponents) {
 		this.integrationComponents = new LinkedHashMap<>(integrationComponents);
 	}
 
@@ -108,9 +109,8 @@ public void setComponentSource(Object source) {
 		this.beanSource = source;
 	}
 
-	@Nullable
 	@Override
-	public Object getComponentSource() {
+	public @Nullable Object getComponentSource() {
 		return this.beanSource;
 	}
 
@@ -119,15 +119,13 @@ public void setComponentDescription(String description) {
 		this.beanDescription = description;
 	}
 
-	@Nullable
 	@Override
-	public String getComponentDescription() {
+	public @Nullable String getComponentDescription() {
 		return this.beanDescription;
 	}
 
-	@Nullable
 	@Override
-	public String getBeanName() {
+	public @Nullable String getBeanName() {
 		return this.beanName;
 	}
 
@@ -136,9 +134,8 @@ public void configure(IntegrationFlowDefinition flow) {
 		throw new UnsupportedOperationException();
 	}
 
-	@Nullable
 	@Override
-	public MessageChannel getInputChannel() {
+	public @Nullable MessageChannel getInputChannel() {
 		if (this.inputChannel == null) {
 			this.inputChannel =
 					this.integrationComponents.keySet()
@@ -153,13 +150,13 @@ public MessageChannel getInputChannel() {
 		return this.inputChannel;
 	}
 
-	public void setIntegrationComponents(Map integrationComponents) {
+	public void setIntegrationComponents(Map integrationComponents) {
 		this.integrationComponents.clear();
 		this.integrationComponents.putAll(integrationComponents);
 	}
 
-	public Map getIntegrationComponents() {
-		return Collections.unmodifiableMap(this.integrationComponents);
+	public Map getIntegrationComponents() {
+		return Collections.unmodifiableMap(this.integrationComponents);
 	}
 
 	@Override
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/TransformerEndpointSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/TransformerEndpointSpec.java
index a4799e33453..e17035682e1 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/TransformerEndpointSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/TransformerEndpointSpec.java
@@ -47,21 +47,19 @@ public class TransformerEndpointSpec extends ConsumerEndpointSpec transformer;
+	private @Nullable GenericTransformer transformer;
 
-	@Nullable
-	private Class expectedType;
+	private @Nullable Class expectedType;
 
-	private MessageProcessorSpec processor;
+	private @Nullable MessageProcessorSpec processor;
 
 	protected TransformerEndpointSpec() {
 		super(new MessageTransformingHandler());
@@ -184,7 +182,7 @@ else if (this.processor != null) {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
+	public Map getComponentsToRegister() {
 		Transformer transformer;
 		if (this.expression != null) {
 			transformer = new ExpressionEvaluatingTransformer(this.expression);
@@ -206,7 +204,7 @@ else if (this.processor != null) {
 			transformer = new MethodInvokingTransformer(targetProcessor);
 		}
 		else if (this.transformer != null) {
-			transformer = wrapToTransformerIfAny();
+			transformer = wrapToTransformerIfAny(this.transformer);
 		}
 		else {
 			throw new IllegalStateException(
@@ -219,11 +217,11 @@ else if (this.transformer != null) {
 		return super.getComponentsToRegister();
 	}
 
-	private Transformer wrapToTransformerIfAny() {
-		return this.transformer instanceof Transformer castTransformer ? castTransformer :
-				(ClassUtils.isLambda(this.transformer)
-						? new MethodInvokingTransformer(new LambdaMessageProcessor(this.transformer, this.expectedType))
-						: new MethodInvokingTransformer(this.transformer, ClassUtils.TRANSFORMER_TRANSFORM_METHOD));
+	private Transformer wrapToTransformerIfAny(GenericTransformer transformer) {
+		return transformer instanceof Transformer castTransformer ? castTransformer :
+				(ClassUtils.isLambda(transformer)
+						? new MethodInvokingTransformer(new LambdaMessageProcessor(transformer, this.expectedType))
+						: new MethodInvokingTransformer(transformer, ClassUtils.TRANSFORMER_TRANSFORM_METHOD));
 	}
 
 }
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/WireTapSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/WireTapSpec.java
index 5097cee675a..70916f7ce5f 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/WireTapSpec.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/WireTapSpec.java
@@ -19,6 +19,8 @@
 import java.util.Collections;
 import java.util.Map;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.expression.Expression;
 import org.springframework.integration.channel.interceptor.WireTap;
 import org.springframework.integration.core.MessageSelector;
@@ -37,13 +39,13 @@
  */
 public class WireTapSpec extends IntegrationComponentSpec implements ComponentsRegistration {
 
-	private final MessageChannel channel;
+	private final @Nullable MessageChannel channel;
 
-	private final String channelName;
+	private final @Nullable String channelName;
 
-	private MessageSelector selector;
+	private @Nullable MessageSelector selector;
 
-	private Long timeout;
+	private @Nullable Long timeout;
 
 	public WireTapSpec(MessageChannel channel) {
 		Assert.notNull(channel, "'channel' must not be null");
@@ -83,6 +85,7 @@ public WireTapSpec timeout(long timeout) {
 	}
 
 	@Override
+	@SuppressWarnings("NullAway") // The constructors flow does not allow both 'channel' and 'channelName' to be null.
 	protected WireTap doGet() {
 		WireTap wireTap;
 		if (this.channel != null) {
@@ -99,12 +102,12 @@ protected WireTap doGet() {
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
+	public Map getComponentsToRegister() {
 		if (this.selector != null) {
-			return Collections.singletonMap(this.selector, null);
+			return Collections.singletonMap(this.selector, null);
 		}
 		else {
-			return Collections.emptyMap();
+			return Collections.emptyMap();
 		}
 	}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java
index f3eeec8d772..036f36a5b02 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java
@@ -55,6 +55,7 @@
 import org.springframework.context.SmartLifecycle;
 import org.springframework.core.ResolvableType;
 import org.springframework.core.io.DescriptiveResource;
+import org.springframework.integration.JavaUtils;
 import org.springframework.integration.channel.AbstractMessageChannel;
 import org.springframework.integration.channel.DirectChannel;
 import org.springframework.integration.channel.FixedSubscriberChannel;
@@ -96,13 +97,16 @@
 public class IntegrationFlowBeanPostProcessor
 		implements BeanPostProcessor, ApplicationContextAware, SmartInitializingSingleton, AopInfrastructureBean {
 
+	@SuppressWarnings("NullAway.Init")
 	private ConfigurableApplicationContext applicationContext;
 
+	@SuppressWarnings("NullAway.Init")
 	private StringValueResolver embeddedValueResolver;
 
+	@SuppressWarnings("NullAway.Init")
 	private DefaultListableBeanFactory beanFactory;
 
-	private volatile IntegrationFlowContext flowContext;
+	private volatile @Nullable IntegrationFlowContext flowContext;
 
 	@Override
 	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
@@ -149,24 +153,27 @@ private Object processStandardIntegrationFlow(StandardIntegrationFlow flow, Stri
 		boolean registerBeanDefinitions = this.beanFactory.containsBeanDefinition(flowBeanName);
 		if (registerBeanDefinitions) {
 			BeanDefinition beanDefinition = this.beanFactory.getBeanDefinition(flowBeanName);
-			flow.setComponentSource(beanDefinition.getSource());
-			flow.setComponentDescription(beanDefinition.getDescription());
+			JavaUtils.INSTANCE
+					.acceptIfNotNull(beanDefinition.getSource(), flow::setComponentSource)
+					.acceptIfNotNull(beanDefinition.getDescription(), flow::setComponentDescription);
 		}
 		Object beanSource = flow.getComponentSource();
 		String beanDescription = flow.getComponentDescription();
 
 		String flowNamePrefix = flowBeanName + ".";
-		if (this.flowContext == null) {
-			this.flowContext = this.beanFactory.getBean(IntegrationFlowContext.class);
+		IntegrationFlowContext flowContextToUse = this.flowContext;
+		if (flowContextToUse == null) {
+			flowContextToUse = this.beanFactory.getBean(IntegrationFlowContext.class);
+			this.flowContext = flowContextToUse;
 		}
-		boolean useFlowIdAsPrefix = this.flowContext.isUseIdAsPrefix(flowBeanName);
+		boolean useFlowIdAsPrefix = flowContextToUse.isUseIdAsPrefix(flowBeanName);
 		int subFlowNameIndex = 0;
 		int channelNameIndex = 0;
 
-		Map integrationComponents = flow.getIntegrationComponents();
-		Map targetIntegrationComponents = new LinkedHashMap<>(integrationComponents.size());
+		Map integrationComponents = flow.getIntegrationComponents();
+		Map targetIntegrationComponents = new LinkedHashMap<>(integrationComponents.size());
 
-		for (Map.Entry entry : integrationComponents.entrySet()) {
+		for (Map.Entry entry : integrationComponents.entrySet()) {
 			Object component = entry.getKey();
 			if (component instanceof ConsumerEndpointSpec endpointSpec) {
 				MessageHandler messageHandler = endpointSpec.getObject().getT2();
@@ -206,7 +213,7 @@ else if (component instanceof MessageChannelReference messageChannelReference) {
 				targetIntegrationComponents.put(channelByName, channelBeanName);
 			}
 			else if (component instanceof SourcePollingChannelAdapterSpec spec) {
-				Map componentsToRegister = spec.getComponentsToRegister();
+				Map componentsToRegister = spec.getComponentsToRegister();
 				if (!CollectionUtils.isEmpty(componentsToRegister)) {
 					componentsToRegister.entrySet()
 							.stream()
@@ -259,7 +266,7 @@ else if (useFlowIdAsPrefix) {
 					}
 					else if (component instanceof FixedSubscriberChannel fixedSubscriberChannel) {
 						String channelBeanName = fixedSubscriberChannel.getComponentName();
-						if ("Unnamed fixed subscriber channel".equals(channelBeanName)) {
+						if ("Unnamed fixed subscriber channel" .equals(channelBeanName)) {
 							channelBeanName = flowNamePrefix + "channel" +
 									BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR + channelNameIndex++;
 						}
@@ -380,15 +387,20 @@ private void processIntegrationComponentSpec(String beanName, IntegrationCompone
 		invokeBeanInitializationHooks(beanName, target);
 
 		if (bean instanceof ComponentsRegistration componentsRegistration) {
-			Map componentsToRegister = componentsRegistration.getComponentsToRegister();
+			Map componentsToRegister = componentsRegistration.getComponentsToRegister();
 			if (!CollectionUtils.isEmpty(componentsToRegister)) {
 				boolean registerBeanDefinitions = this.beanFactory.containsBeanDefinition(beanName);
-				BeanDefinition beanDefinition = null;
+				Object beanDefinitionSource;
+				String beanDefinitionDescription;
 				if (registerBeanDefinitions) {
-					beanDefinition = this.beanFactory.getBeanDefinition(beanName);
+					BeanDefinition beanDefinition = this.beanFactory.getBeanDefinition(beanName);
+					beanDefinitionSource = beanDefinition.getSource();
+					beanDefinitionDescription = beanDefinition.getDescription();
+				}
+				else {
+					beanDefinitionSource = null;
+					beanDefinitionDescription = null;
 				}
-				Object beanDefinitionSource = registerBeanDefinitions ? beanDefinition.getSource() : null;
-				String beanDefinitionDescription = registerBeanDefinitions ? beanDefinition.getDescription() : null;
 				componentsToRegister.entrySet()
 						.stream()
 						.filter(component -> noBeanPresentForComponent(component.getKey(), beanName))
@@ -514,8 +526,9 @@ private void registerSingleton(Object component, String beanName, @Nullable Obje
 			@Nullable String description, @Nullable String parentName) {
 
 		if (component instanceof ComponentSourceAware componentSourceAware) {
-			componentSourceAware.setComponentSource(source);
-			componentSourceAware.setComponentDescription(description);
+			JavaUtils.INSTANCE
+					.acceptIfNotNull(source, componentSourceAware::setComponentSource)
+					.acceptIfNotNull(description, componentSourceAware::setComponentDescription);
 		}
 
 		if (parentName != null) {
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowLifecycleAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowLifecycleAdvice.java
index 00847e9904f..6935fa4a22c 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowLifecycleAdvice.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowLifecycleAdvice.java
@@ -68,7 +68,7 @@ class IntegrationFlowLifecycleAdvice implements MethodInterceptor {
 	}
 
 	@Override
-	public Object invoke(MethodInvocation invocation) throws Throwable {
+	public @Nullable Object invoke(MethodInvocation invocation) throws Throwable {
 		Object target = invocation.getThis();
 		String method = invocation.getMethod().getName();
 		Object result = null;
@@ -105,7 +105,7 @@ private Object applyToDelegate(MethodInvocation invocation, String method, @Null
 				break;
 
 			case "stop":
-				Object[] arguments = invocation.getArguments();
+				var arguments = invocation.getArguments();
 				if (!ObjectUtils.isEmpty(arguments)) {
 					this.delegate.stop((Runnable) arguments[0]);
 				}
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowContext.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowContext.java
index 0b72a26d5bf..519369c7733 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowContext.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowContext.java
@@ -19,6 +19,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -61,6 +62,7 @@ public final class StandardIntegrationFlowContext implements IntegrationFlowCont
 
 	private final Lock registerFlowsLock = new ReentrantLock();
 
+	@SuppressWarnings("NullAway.Init")
 	private DefaultListableBeanFactory beanFactory;
 
 	StandardIntegrationFlowContext() {
@@ -223,8 +225,7 @@ private void removeDependantBeans(String parentName) {
 	 */
 	@Override
 	public MessagingTemplate messagingTemplateFor(String flowId) {
-		return this.registry.get(flowId)
-				.getMessagingTemplate();
+		return Objects.requireNonNull(this.registry.get(flowId)).getMessagingTemplate();
 	}
 
 	/**
@@ -261,21 +262,19 @@ private String generateBeanName(Object instance, @Nullable String parentName) {
 	 */
 	public final class StandardIntegrationFlowRegistrationBuilder implements IntegrationFlowRegistrationBuilder {
 
-		private final Map additionalBeans = new HashMap<>();
+		private final Map additionalBeans = new HashMap<>();
 
 		private IntegrationFlow integrationFlow;
 
-		private String id;
+		private @Nullable String id;
 
 		private boolean autoStartup = true;
 
 		private boolean idAsPrefix;
 
-		@Nullable
-		private Object source;
+		private @Nullable Object source;
 
-		@Nullable
-		private String description;
+		private @Nullable String description;
 
 		StandardIntegrationFlowRegistrationBuilder(IntegrationFlow integrationFlow) {
 			this.integrationFlow = integrationFlow;
@@ -377,9 +376,9 @@ private static final class IntegrationFlowComponentSourceAwareAdapter
 
 		private final IntegrationFlow delegate;
 
-		private Object beanSource;
+		private @Nullable Object beanSource;
 
-		private String beanDescription;
+		private @Nullable String beanDescription;
 
 		IntegrationFlowComponentSourceAwareAdapter(IntegrationFlow delegate) {
 			this.delegate = delegate;
@@ -391,7 +390,7 @@ public void setComponentSource(Object source) {
 		}
 
 		@Override
-		public Object getComponentSource() {
+		public @Nullable Object getComponentSource() {
 			return this.beanSource;
 		}
 
@@ -401,7 +400,7 @@ public void setComponentDescription(String description) {
 		}
 
 		@Override
-		public String getComponentDescription() {
+		public @Nullable String getComponentDescription() {
 			return this.beanDescription;
 		}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowRegistration.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowRegistration.java
index f5a481a777f..6538930ccca 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowRegistration.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/StandardIntegrationFlowRegistration.java
@@ -16,6 +16,8 @@
 
 package org.springframework.integration.dsl.context;
 
+import org.jspecify.annotations.Nullable;
+
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.context.Lifecycle;
@@ -26,7 +28,7 @@
 import org.springframework.messaging.MessageChannel;
 
 /**
- * Instances of this classes are returned as a result of
+ * Instances of this class are returned as a result of
  * {@link StandardIntegrationFlowContext#registration(IntegrationFlow)} invocation
  * and provide an API for some useful {@link IntegrationFlow} options and its lifecycle.
  *
@@ -46,10 +48,11 @@ class StandardIntegrationFlowRegistration implements IntegrationFlowRegistration
 
 	private final String id;
 
-	private MessageChannel inputChannel;
+	private @Nullable MessageChannel inputChannel;
 
-	private MessagingTemplate messagingTemplate;
+	private @Nullable MessagingTemplate messagingTemplate;
 
+	@SuppressWarnings("NullAway.Init")
 	private ConfigurableListableBeanFactory beanFactory;
 
 	StandardIntegrationFlowRegistration(IntegrationFlow integrationFlow, IntegrationFlowContext integrationFlowContext,
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/package-info.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/package-info.java
index 6067b368bfb..32900fdacc7 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/package-info.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/context/package-info.java
@@ -1,5 +1,5 @@
 /**
  * The context support classes for Spring Integration Java DSL.
  */
-@org.springframework.lang.NonNullApi
+@org.jspecify.annotations.NullMarked
 package org.springframework.integration.dsl.context;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/package-info.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/package-info.java
index 6d9ccd85690..f3dcb9e9c70 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/package-info.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/package-info.java
@@ -1,5 +1,5 @@
 /**
  * Root package of the Spring Integration Java DSL.
  */
-@org.springframework.lang.NonNullApi
+@org.jspecify.annotations.NullMarked
 package org.springframework.integration.dsl;
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java
index d92e784266f..2aae734eb63 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/FixedSubscriberChannelPrototype.java
@@ -34,7 +34,7 @@
  */
 public class FixedSubscriberChannelPrototype implements MessageChannel {
 
-	private final String name;
+	private final @Nullable String name;
 
 	public FixedSubscriberChannelPrototype() {
 		this(null);
@@ -44,7 +44,7 @@ public FixedSubscriberChannelPrototype(@Nullable String name) {
 		this.name = name;
 	}
 
-	public String getName() {
+	public @Nullable String getName() {
 		return this.name;
 	}
 
diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/package-info.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/package-info.java
index 16ab723fd2d..76915b506d0 100644
--- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/package-info.java
+++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/support/package-info.java
@@ -1,5 +1,5 @@
 /**
  * Provides various support classes used across Spring Integration Java DSL Components.
  */
-@org.springframework.lang.NonNullApi
+@org.jspecify.annotations.NullMarked
 package org.springframework.integration.dsl.support;
diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java
index b544520beec..5001f18ae25 100644
--- a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java
+++ b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java
@@ -18,8 +18,6 @@
 
 import java.io.File;
 
-import org.jspecify.annotations.Nullable;
-
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.integration.dsl.MessageProducerSpec;
@@ -43,7 +41,6 @@ public class TailAdapterSpec extends MessageProducerSpec getComponentsToRegister() {
-		return Collections.singletonMap(this.storedProcExecutor, null);
+	public Map getComponentsToRegister() {
+		return Collections.singletonMap(this.storedProcExecutor, null);
 	}
 
 }
diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundChannelAdapterSpec.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundChannelAdapterSpec.java
index e16b5b24287..36b2ba305f4 100644
--- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundChannelAdapterSpec.java
+++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundChannelAdapterSpec.java
@@ -71,8 +71,8 @@ public JdbcStoredProcOutboundChannelAdapterSpec configurerStoredProcExecutor(
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
-		return Collections.singletonMap(this.storedProcExecutor, null);
+	public Map getComponentsToRegister() {
+		return Collections.singletonMap(this.storedProcExecutor, null);
 	}
 
 }
diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundGatewaySpec.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundGatewaySpec.java
index 824067e7e1d..9072199e0b8 100644
--- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundGatewaySpec.java
+++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/dsl/JdbcStoredProcOutboundGatewaySpec.java
@@ -89,8 +89,8 @@ public JdbcStoredProcOutboundGatewaySpec expectSingleResult(boolean expectSingle
 	}
 
 	@Override
-	public Map getComponentsToRegister() {
-		return Collections.singletonMap(this.storedProcExecutor, null);
+	public Map getComponentsToRegister() {
+		return Collections.singletonMap(this.storedProcExecutor, null);
 	}
 
 }
diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/Jms.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/Jms.java
index e2804952cb0..d3640c91b9d 100644
--- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/Jms.java
+++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/Jms.java
@@ -18,7 +18,6 @@
 
 import jakarta.jms.ConnectionFactory;
 import jakarta.jms.Destination;
-import org.jspecify.annotations.Nullable;
 
 import org.springframework.integration.jms.PollableJmsChannel;
 import org.springframework.jms.core.JmsTemplate;
@@ -44,7 +43,7 @@ public final class Jms {
 	public static JmsPollableMessageChannelSpec pollableChannel(
 			ConnectionFactory connectionFactory) {
 
-		return pollableChannel(null, connectionFactory);
+		return new JmsPollableMessageChannelSpec<>(connectionFactory);
 	}
 
 	/**
@@ -53,7 +52,7 @@ public static JmsPollableMessageChannelSpec pollableChann
 	 * @param connectionFactory the JMS ConnectionFactory to build on
 	 * @return the {@link JmsPollableMessageChannelSpec} instance
 	 */
-	public static JmsPollableMessageChannelSpec pollableChannel(@Nullable String id,
+	public static JmsPollableMessageChannelSpec pollableChannel(String id,
 			ConnectionFactory connectionFactory) {
 
 		JmsPollableMessageChannelSpec spec =
@@ -67,7 +66,7 @@ public static JmsPollableMessageChannelSpec pollableChann
 	 * @return the {@link JmsMessageChannelSpec} instance
 	 */
 	public static JmsMessageChannelSpec channel(ConnectionFactory connectionFactory) {
-		return channel(null, connectionFactory);
+		return new JmsMessageChannelSpec<>(connectionFactory);
 	}
 
 	/**
@@ -76,7 +75,7 @@ public static JmsPollableMessageChannelSpec pollableChann
 	 * @param connectionFactory the JMS ConnectionFactory to build on
 	 * @return the {@link JmsMessageChannelSpec} instance
 	 */
-	public static JmsMessageChannelSpec channel(@Nullable String id, ConnectionFactory connectionFactory) {
+	public static JmsMessageChannelSpec channel(String id, ConnectionFactory connectionFactory) {
 		return new JmsMessageChannelSpec<>(connectionFactory)
 				.id(id);
 	}
@@ -87,7 +86,7 @@ public static JmsPollableMessageChannelSpec pollableChann
 	 * @return the {@link JmsPublishSubscribeMessageChannelSpec} instance
 	 */
 	public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(ConnectionFactory connectionFactory) {
-		return publishSubscribeChannel(null, connectionFactory);
+		return new JmsPublishSubscribeMessageChannelSpec(connectionFactory);
 	}
 
 	/**
@@ -96,7 +95,7 @@ public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(Conn
 	 * @param connectionFactory the JMS ConnectionFactory to build on
 	 * @return the {@link JmsPublishSubscribeMessageChannelSpec} instance
 	 */
-	public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(@Nullable String id,
+	public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(String id,
 			ConnectionFactory connectionFactory) {
 
 		return new JmsPublishSubscribeMessageChannelSpec(connectionFactory).id(id);
diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsDestinationAccessorSpec.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsDestinationAccessorSpec.java
index a0457962cc9..1a02f6c54ff 100644
--- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsDestinationAccessorSpec.java
+++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsDestinationAccessorSpec.java
@@ -17,7 +17,6 @@
 package org.springframework.integration.jms.dsl;
 
 import jakarta.jms.ConnectionFactory;
-import org.jspecify.annotations.Nullable;
 
 import org.springframework.integration.dsl.IntegrationComponentSpec;
 import org.springframework.jms.support.destination.DestinationResolver;
@@ -46,7 +45,7 @@ protected S connectionFactory(ConnectionFactory connectionFactory) {
 	}
 
 	@Override
-	public S id(@Nullable String id) { // NOSONAR - not useless, increases visibility
+	public S id(String id) {
 		return super.id(id);
 	}
 
diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsPollableMessageChannelSpec.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsPollableMessageChannelSpec.java
index 473da6168a0..a7cec93d31b 100644
--- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsPollableMessageChannelSpec.java
+++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsPollableMessageChannelSpec.java
@@ -18,7 +18,6 @@
 
 import jakarta.jms.ConnectionFactory;
 import jakarta.jms.Destination;
-import org.jspecify.annotations.Nullable;
 
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
@@ -59,10 +58,8 @@ protected JmsPollableMessageChannelSpec(JmsChannelFactoryBean jmsChannelFactoryB
 	}
 
 	@Override
-	protected S id(@Nullable String id) {
-		if (id != null) {
-			this.jmsChannelFactoryBean.setBeanName(id);
-		}
+	protected S id(String id) {
+		this.jmsChannelFactoryBean.setBeanName(id);
 		return super.id(id);
 	}
 
diff --git a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/AbstractKafkaChannelSpec.java b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/AbstractKafkaChannelSpec.java
index 4204c0980c9..dbe771573c4 100644
--- a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/AbstractKafkaChannelSpec.java
+++ b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/AbstractKafkaChannelSpec.java
@@ -36,11 +36,10 @@
 public abstract class AbstractKafkaChannelSpec, C extends AbstractKafkaChannel>
 		extends MessageChannelSpec {
 
-	@Nullable
-	protected String groupId; // NOSONAR
+	protected @Nullable String groupId;
 
 	@Override
-	public S id(@Nullable String idToSet) { // NOSONAR - increase visibility
+	public S id(String idToSet) {
 		return super.id(idToSet);
 	}
 
diff --git a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaMessageListenerContainerSpec.java b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaMessageListenerContainerSpec.java
index da75c78ed7b..729b7281535 100644
--- a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaMessageListenerContainerSpec.java
+++ b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaMessageListenerContainerSpec.java
@@ -20,7 +20,6 @@
 
 import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
 import org.apache.kafka.clients.consumer.OffsetCommitCallback;
-import org.jspecify.annotations.Nullable;
 
 import org.springframework.core.task.AsyncTaskExecutor;
 import org.springframework.integration.dsl.IntegrationComponentSpec;
@@ -66,7 +65,7 @@ public class KafkaMessageListenerContainerSpec
 	}
 
 	@Override
-	public KafkaMessageListenerContainerSpec id(@Nullable String id) { // NOSONAR - increase visibility
+	public KafkaMessageListenerContainerSpec id(String id) {
 		return super.id(id);
 	}
 
diff --git a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaTemplateSpec.java b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaTemplateSpec.java
index 540b004eb27..519bee531b0 100644
--- a/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaTemplateSpec.java
+++ b/spring-integration-kafka/src/main/java/org/springframework/integration/kafka/dsl/KafkaTemplateSpec.java
@@ -16,8 +16,6 @@
 
 package org.springframework.integration.kafka.dsl;
 
-import org.jspecify.annotations.Nullable;
-
 import org.springframework.integration.dsl.IntegrationComponentSpec;
 import org.springframework.kafka.core.KafkaTemplate;
 import org.springframework.kafka.core.ProducerFactory;
@@ -51,7 +49,7 @@ public KafkaTemplate getTemplate() {
 	}
 
 	@Override
-	public KafkaTemplateSpec id(@Nullable String id) { // NOSONAR - visibility
+	public KafkaTemplateSpec id(String id) {
 		return super.id(id);
 	}