Skip to content

Remove and replace deprecated APIs marked for removal in 2.0.x #1209

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
Expand Up @@ -18,8 +18,6 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.apache.pulsar.client.api.SubscriptionType;
Expand All @@ -34,18 +32,6 @@
*/
class DefaultReactivePulsarListenerContainerFactoryTests {

@SuppressWarnings({ "removal", "unchecked" })
@Test
void deprecatedCreateListenerContainerCallsReplacementApi() {
var containerFactory = spy(new DefaultReactivePulsarListenerContainerFactory<String>(
mock(ReactivePulsarConsumerFactory.class), new ReactivePulsarContainerProperties<>()));
var endpoint = mock(ReactivePulsarListenerEndpoint.class);
when(endpoint.getConcurrency()).thenReturn(1);
var createdContainer = containerFactory.createListenerContainer(endpoint);
assertThat(createdContainer).isNotNull();
verify(containerFactory).createRegisteredContainer(endpoint);
}

@SuppressWarnings("unchecked")
@Nested
class SubscriptionTypeFrom {
Expand Down

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions spring-pulsar/spring-pulsar.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
api 'org.springframework:spring-context'
api 'org.springframework:spring-messaging'
api 'org.springframework:spring-tx'
testImplementation libs.spring.boot.starter.pulsar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since PulsarContainerFactoryCustomizer is only available directly in the starter, we should do this.

To be honest, I don't think this is a very good solution either. As an alternative, I would suggest making the test an integration test and moving it to the samples. To be honest, I don't see any other solution. What do you think?

api (libs.spring.retry) {
exclude group: 'org.springframework'
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B
new RootBeanDefinition(PulsarTemplateBeanCustomizerPostProcessor.class));
}

if (!registry.containsBeanDefinition("concurrentContainerFactoryCustomizerPostProcessor")) {
registry.registerBeanDefinition("concurrentContainerFactoryCustomizerPostProcessor",
new RootBeanDefinition(ConcurrentPulsarListenerContainerFactoryBeanCustomizerPostProcessor.class));
}

if (!registry
.containsBeanDefinition(PulsarAnnotationSupportBeanNames.PULSAR_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)) {
registry.registerBeanDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,6 @@ public ConcurrentPulsarListenerContainerFactory(PulsarConsumerFactory<? super T>
super(consumerFactory, containerProperties);
}

/**
* Specify the container concurrency.
* @param concurrency the number of consumers to create.
* @deprecated since 1.2.0 for removal in 2.0.0 in favor of
* {@link PulsarContainerProperties#setConcurrency}
*/
@Deprecated(since = "1.2.0", forRemoval = true)
public void setConcurrency(Integer concurrency) {
getContainerProperties().setConcurrency(concurrency);
}

@Override
public ConcurrentPulsarMessageListenerContainer<T> createContainer(String... topics) {
PulsarListenerEndpoint endpoint = new PulsarListenerEndpoint() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,4 @@
public interface ListenerContainerFactory<C extends MessageListenerContainer, E extends ListenerEndpoint<C>>
extends PulsarContainerFactory<C, E> {

/**
* Create a {@link MessageListenerContainer} for the given {@link ListenerEndpoint}.
* Containers created using this method are added to the listener endpoint registry.
* @param endpoint the endpoint to configure
* @return the created container
* @deprecated since 1.2.0 for removal in 1.4.0 in favor of
* {@link PulsarContainerFactory#createRegisteredContainer}
*/
@Deprecated(since = "1.2.0", forRemoval = true)
default C createListenerContainer(E endpoint) {
return createRegisteredContainer(endpoint);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,4 @@
public interface ReaderContainerFactory<C extends PulsarMessageReaderContainer, E extends PulsarReaderEndpoint<C>>
extends PulsarContainerFactory<C, E> {

/**
* Create a message reader container for the given endpoint and register the container
* with the listener endpoint registry.
* @param endpoint reader endpoint
* @return the created container
* @deprecated since 1.2.0 for removal in 1.4.0 in favor of
* {@link PulsarContainerFactory#createRegisteredContainer}
*/
@Deprecated(since = "1.2.0", forRemoval = true)
default C createReaderContainer(E endpoint) {
return createRegisteredContainer(endpoint);
}

/**
* Create a message reader container for the given endpoint.
* @param topics the topics to read from
* @return the created container
* @deprecated since 1.2.0 for removal in 1.4.0 in favor of
* {@link PulsarContainerFactory#createContainer}
*/
@Deprecated(since = "1.2.0", forRemoval = true)
default C createReaderContainer(String... topics) {
return createContainer(topics);
}

}
Loading
Loading