Skip to content

Commit

Permalink
deprecate rxjava and completableFuture API in main branch (Azure#24720)
Browse files Browse the repository at this point in the history
* deprecate rxjava and completableFuture API in main

* Remove unused imports

* add changelog and update readme
  • Loading branch information
yiliuTo authored Oct 12, 2021
1 parent d37ed4c commit 6c6b0f3
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- Deprecate RxJava support APIs, which will be dropped from version 4.0.0.

## 2.9.0 (2021-09-27)
This release is compatible with Spring Boot 2.5.0 - 2.5.4 and Spring Cloud 2020.0.3.
Expand Down
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-cloud-starter-eventhubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ For Spring Integration on Event Hubs, please refer to the [source code][source_c
## Key concepts
Azure Event Hubs is a big data streaming platform and event ingestion service. It can receive and process millions of events per second. Data sent to an event hub can be transformed and stored by using any real-time analytics provider or batching/storage adapters.

Note: RxJava support APIs have been deprecated from version 2.10.0, and will be dropped from version 4.0.0.
Please refer to Javadoc for details.
## Examples
Please refer to this [sample project][sample] illustrating how to use Spring Cloud Event Hubs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- Deprecate CompletableFuture support API, which will be replaced by Reactor Core from version 4.0.0.

## 2.9.0 (2021-09-27)
This release is compatible with Spring Boot 2.5.0 - 2.5.4 and Spring Cloud 2020.0.3.
Expand Down
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-cloud-starter-servicebus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The Spring Cloud Service Bus starter helps developers to finish the auto-configu

This project provides Spring Integration adaption with Azure Service Bus and the ability to auto-configure connection to Azure Service Bus.

Note: CompletableFuture support APIs have been deprecated from version 2.10.0, and will be replaced by Reactor Core from version 4.0.0.
Please refer to Javadoc for details.
### Configure ServiceBusMessageConverter to customize ObjectMapper
`ServiceBusMessageConverter` is made as a configurable bean to allow users to customized `ObjectMapper`.

Expand Down
1 change: 1 addition & 0 deletions sdk/spring/azure-spring-integration-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- Deprecate RxJava and CompletableFuture support API, which will be dropped from version 4.0.0.

## 2.9.0 (2021-09-27)
This release is compatible with Spring Boot 2.5.0 - 2.5.4 and Spring Cloud 2020.0.3.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

/**
* Azure implementation for check point callback.
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.AzureCheckpointer}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.checkpoint.AzureCheckpointer.
*/
@Deprecated
public class AzureCheckpointer implements Checkpointer {
private final Supplier<CompletableFuture<Void>> success;
private final Supplier<CompletableFuture<Void>> fail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
* It delegates real operation to {@link SendOperation} which supports synchronous and asynchronous sending.
*
* @author Warren Zhu
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.DefaultMessageHandler}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.DefaultMessageHandler.
*/
@Deprecated
public class DefaultMessageHandler extends AbstractMessageProducingHandler {
private static final Logger LOG = LoggerFactory.getLogger(DefaultMessageHandler.class);
private static final long DEFAULT_SEND_TIMEOUT = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
* Operations for sending {@link Collection}&lt;{@link Message}&gt; to a destination.
*
* @author Warren Zhu
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.BatchSendOperation}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.BatchSendOperation.
*/
@Deprecated
public interface BatchSendOperation {

/**
Expand All @@ -23,7 +28,12 @@ public interface BatchSendOperation {
* @param partitionSupplier partition supplier
* @param <T> payload class type in message
* @return Future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.BatchSendOperation}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.BatchSendOperation.
*/
@Deprecated
<T> CompletableFuture<Void> sendAsync(String destination, Collection<Message<T>> messages,
PartitionSupplier partitionSupplier);

Expand All @@ -33,7 +43,12 @@ <T> CompletableFuture<Void> sendAsync(String destination, Collection<Message<T>>
* @param messages messages
* @param <T> payload class type in message
* @return Future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.BatchSendOperation}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.BatchSendOperation.
*/
@Deprecated
default <T> CompletableFuture<Void> sendAsync(String destination, Collection<Message<T>> messages) {
return sendAsync(destination, messages, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,33 @@
* A callback to perform checkpoint.
*
* @author Warren Zhu
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.Checkpointer}. From version 4.0.0, the reactor PAI support will
* be move to com.azure.spring.messaging.core.checkpoint.Checkpointer.
*/
@Deprecated
public interface Checkpointer {

/**
* Acknowledge success of current message. Please check result to detect failure
* @return completable future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.Checkpointer}. From version 4.0.0, the reactor PAI support will
* be move to com.azure.spring.messaging.core.checkpoint.Checkpointer.
*/
@Deprecated
CompletableFuture<Void> success();

/**
* Fail current message. Please check result to detect failure
* @return completable future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.Checkpointer}. From version 4.0.0, the reactor PAI support will
* be move to com.azure.spring.messaging.core.checkpoint.Checkpointer.
*/
@Deprecated
CompletableFuture<Void> failure();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
* Operations for sending {@link Message} to a destination in a reactive way.
*
* @author Warren Zhu
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support will
* be moved to com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
public interface RxSendOperation {

/**
Expand All @@ -20,7 +25,12 @@ public interface RxSendOperation {
* @param partitionSupplier partition supplier
* @param <T> payload type in message
* @return observable instance
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support will
* be moved to com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
<T> Observable<Void> sendRx(String destination, Message<T> message, PartitionSupplier partitionSupplier);

/**
Expand All @@ -29,7 +39,12 @@ public interface RxSendOperation {
* @param message message
* @param <T> payload type in message
* @return observable instance
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support will
* be moved to com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
default <T> Observable<Void> sendRx(String destination, Message<T> message) {
return sendRx(destination, message, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
* Operations for subscribing to a destination with a consumer group in a reactive way.
*
* @author Warren Zhu
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link SubscribeByGroupOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.messaging.core.SubscribeByGroupOperation.
*/
@Deprecated
public interface RxSubscribeByGroupOperation extends Checkpointable {

/**
Expand All @@ -19,7 +23,12 @@ public interface RxSubscribeByGroupOperation extends Checkpointable {
* @param consumerGroup consumer group
* @param messagePayloadType message payload type
* @return {@code Observable<Message<?>>}
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link SubscribeByGroupOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.messaging.core.SubscribeByGroupOperation.
*/
@Deprecated
Observable<Message<?>> subscribe(String destination, String consumerGroup,
Class<?> messagePayloadType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,26 @@
* Operations for subscribing to a destination in reactive way.
*
* @author Warren Zhu
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link SubscribeOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.messaging.core.SubscribeOperation.
*/
@Deprecated
public interface RxSubscribeOperation {

/**
* Register a message consumer to a given destination.
* @param destination destination
* @param messagePayloadType message payload type
* @return {@code Observable<Message<?>>}
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link SubscribeOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.messaging.core.SubscribeOperation.
*/
@Deprecated
Observable<Message<?>> subscribe(String destination, Class<?> messagePayloadType);

@Deprecated
void setCheckpointMode(CheckpointMode checkpointMode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
* Operations for sending {@link Message} to a destination.
*
* @author Warren Zhu
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support
* will be moved to com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
public interface SendOperation {

/**
Expand All @@ -22,7 +27,12 @@ public interface SendOperation {
* @param partitionSupplier partition supplier
* @param <T> payload type in message
* @return future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API.
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support
* will be moved to package com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
<T> CompletableFuture<Void> sendAsync(String destination, Message<T> message, PartitionSupplier partitionSupplier);

/**
Expand All @@ -31,7 +41,12 @@ public interface SendOperation {
* @param message message
* @param <T> payload type in message
* @return future instance
*
* @deprecated {@link CompletableFuture} API will be dropped in version 4.0.0, please migrate to reactor API
* {@link com.azure.spring.integration.core.api.reactor.SendOperation}. From version 4.0.0, the reactor API support
* will be moved to package com.azure.spring.messaging.core.SendOperation.
*/
@Deprecated
default <T> CompletableFuture<Void> sendAsync(String destination, Message<T> message) {
return sendAsync(destination, message, null);
}
Expand Down
1 change: 1 addition & 0 deletions sdk/spring/azure-spring-integration-eventhubs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- Deprecate RxJava support APIs, which will be dropped from version 4.0.0.

## 2.9.0 (2021-09-27)
This release is compatible with Spring Boot 2.5.0 - 2.5.4 and Spring Cloud 2020.0.3.
Expand Down
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-integration-eventhubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Event Hubs is a fully managed, real-time data ingestion service that’s simple,
## Key concepts
Spring Integration enables lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters. Those adapters provide a higher-level of abstraction over Spring’s support for remoting, messaging, and scheduling.

Note: RxJava support APIs have been deprecated from version 2.10.0, and will be dropped from version 4.0.0.
Please refer to Javadoc for details.
## Examples
Please refer to this [sample project][sample] illustrating how to use Event Hubs integration.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
* Azure event hub operation to support send and subscribe in a reactive way
*
* @author Warren Zhu
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link EventHubOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.eventhubs.core.EventHubOperation.
*/
@Deprecated
public interface EventHubRxOperation extends RxSendOperation, RxSubscribeByGroupOperation {

@Deprecated
void setStartPosition(StartPosition startPosition);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
*
* @author Warren Zhu
* @author Xiaolu Dai
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link EventHubTemplate}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.eventhubs.core.EventHubTemplate.
*/
@Deprecated
public class EventHubRxTemplate extends AbstractEventHubTemplate implements EventHubRxOperation {

private final ConcurrentHashMap<Tuple<String, String>, Observable<Message<?>>> subjectByNameAndGroup =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@

/**
* Rx implementation for {@link EventHubTestOperation}.
*
* @deprecated {@link rx} API will be dropped in version 4.0.0, please migrate to reactor API in
* {@link EventHubTestOperation}. From version 4.0.0, the reactor API support will be moved to
* com.azure.spring.eventhubs.support.EventHubTestOperation.
*/
@Deprecated
public class RxEventHubTestOperation extends EventHubTestOperation implements EventHubRxOperation {
private final ConcurrentHashMap<Tuple<String, String>, Observable<Message<?>>> subjectByNameAndGroup =
new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
- Deprecate CompletableFuture support APIs, which will be replaced by Reactor Core from version 4.0.0.

## 2.9.0 (2021-09-27)
This release is compatible with Spring Boot 2.5.0 - 2.5.4 and Spring Cloud 2020.0.3.
Expand Down
2 changes: 2 additions & 0 deletions sdk/spring/azure-spring-integration-servicebus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Service Bus offers a reliable and secure platform for asynchronous transfer of d

This project provides inbound and outbound channel adapters for Azure Service Bus.

Note: CompletableFuture support APIs have been deprecated from version 2.10.0, and will be replaced by Reactor Core from version 4.0.0.
Please refer to Javadoc for details.
### Configure ServiceBusMessageConverter to customize ObjectMapper
`ServiceBusMessageConverter` is made as a configurable bean to allow users to customized `ObjectMapper`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.azure.spring.integration.servicebus.health.InstrumentationManager;
import org.springframework.messaging.Message;


/**
* Azure service bus queue operation to support send
* {@link org.springframework.messaging.Message} asynchronously and subscribe and abandon
Expand Down

0 comments on commit 6c6b0f3

Please sign in to comment.