Skip to content

GH-8586: Deprecate IntegrationComponentSpec.get() #8594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 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.
Expand Down Expand Up @@ -43,13 +43,13 @@ public abstract class AmqpInboundChannelAdapterSpec
protected final MessageListenerContainerSpec<?, C> listenerContainerSpec; // NOSONAR final

protected AmqpInboundChannelAdapterSpec(MessageListenerContainerSpec<?, C> listenerContainerSpec) {
super(new AmqpInboundChannelAdapter(listenerContainerSpec.get()));
super(new AmqpInboundChannelAdapter(listenerContainerSpec.getObject()));
this.listenerContainerSpec = listenerContainerSpec;
}

@Override
public Map<Object, String> getComponentsToRegister() {
return Collections.singletonMap(this.listenerContainerSpec.get(), this.listenerContainerSpec.getId());
return Collections.singletonMap(this.listenerContainerSpec.getObject(), this.listenerContainerSpec.getId());
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 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.
Expand Down Expand Up @@ -43,7 +43,7 @@ public abstract class AmqpInboundGatewaySpec
protected final AbstractMessageListenerContainerSpec<?, C> listenerContainerSpec; // NOSONAR final

protected AmqpInboundGatewaySpec(AbstractMessageListenerContainerSpec<?, C> listenerContainerSpec) {
super(new AmqpInboundGateway(listenerContainerSpec.get()));
super(new AmqpInboundGateway(listenerContainerSpec.getObject()));
this.listenerContainerSpec = listenerContainerSpec;
}

Expand All @@ -53,16 +53,16 @@ protected AmqpInboundGatewaySpec(AbstractMessageListenerContainerSpec<?, C> list
* @param listenerContainerSpec the {@link AbstractMessageListenerContainerSpec} to use.
* @param amqpTemplate the {@link AmqpTemplate} to use.
*/
AmqpInboundGatewaySpec(
AbstractMessageListenerContainerSpec<?, C> listenerContainerSpec,
AmqpInboundGatewaySpec(AbstractMessageListenerContainerSpec<?, C> listenerContainerSpec,
AmqpTemplate amqpTemplate) {
super(new AmqpInboundGateway(listenerContainerSpec.get(), amqpTemplate));

super(new AmqpInboundGateway(listenerContainerSpec.getObject(), amqpTemplate));
this.listenerContainerSpec = listenerContainerSpec;
}

@Override
public Map<Object, String> getComponentsToRegister() {
return Collections.singletonMap(this.listenerContainerSpec.get(), this.listenerContainerSpec.getId());
return Collections.singletonMap(this.listenerContainerSpec.getObject(), this.listenerContainerSpec.getId());
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2023 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.
Expand Down Expand Up @@ -122,7 +122,7 @@ public RabbitStreamMessageHandlerSpec sendFailureChannel(String channel) {
* Set to true to wait for a confirmation.
* @param sync true to wait.
* @return this spec.
* @see #setConfirmTimeout(long)
* @see #confirmTimeout(long)
*/
public RabbitStreamMessageHandlerSpec sync(boolean sync) {
this.target.setSync(sync);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 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.
Expand Down Expand Up @@ -50,6 +50,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.amqp.channel.AbstractAmqpChannel;
import org.springframework.integration.amqp.channel.PollableAmqpChannel;
import org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.BatchMode;
import org.springframework.integration.amqp.inbound.AmqpInboundGateway;
import org.springframework.integration.amqp.support.AmqpHeaderMapper;
Expand Down Expand Up @@ -472,15 +473,16 @@ public IntegrationFlow amqpAsyncOutboundFlow(AsyncRabbitTemplate asyncRabbitTemp
}

@Bean
public AbstractAmqpChannel unitChannel(ConnectionFactory rabbitConnectionFactory) {
public AmqpPollableMessageChannelSpec<?, PollableAmqpChannel> unitChannel(
ConnectionFactory rabbitConnectionFactory) {

return Amqp.pollableChannel(rabbitConnectionFactory)
.queueName("si.dsl.test")
.channelTransacted(true)
.extractPayload(true)
.inboundHeaderMapper(mapperIn())
.outboundHeaderMapper(mapperOut())
.defaultDeliveryMode(MessageDeliveryMode.NON_PERSISTENT)
.get();
.defaultDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2022 the original author or authors.
* Copyright 2021-2023 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.
Expand Down Expand Up @@ -36,6 +36,8 @@
/**
* @author Gary Russell
* @author Chris Bono
* @author Artem Bilan
*
* @since 6.0
*/
public class RabbitStreamMessageHandlerTests implements RabbitTestContainer {
Expand All @@ -56,7 +58,7 @@ void convertAndSend() throws InterruptedException {

RabbitStreamMessageHandler handler = RabbitStream.outboundStreamAdapter(streamTemplate)
.sync(true)
.get();
.getObject();

handler.handleMessage(MessageBuilder.withPayload("foo")
.setHeader("bar", "baz")
Expand Down
Loading