File tree Expand file tree Collapse file tree 8 files changed +30
-4
lines changed
sdk-actors/src/main/java/io/dapr/actors/client
sdk/src/main/java/io/dapr Expand file tree Collapse file tree 8 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 21
21
import io .grpc .Channel ;
22
22
import io .grpc .ManagedChannel ;
23
23
import io .grpc .ManagedChannelBuilder ;
24
+ import org .slf4j .Logger ;
25
+ import org .slf4j .LoggerFactory ;
24
26
import reactor .core .publisher .Mono ;
25
27
26
28
/**
27
29
* Holds a client for Dapr sidecar communication. ActorClient should be reused.
28
30
*/
29
31
public class ActorClient implements AutoCloseable {
30
32
33
+ private static final Logger LOGGER = LoggerFactory .getLogger (ActorClient .class );
34
+
31
35
/**
32
36
* gRPC channel for communication with Dapr sidecar.
33
37
*/
@@ -118,7 +122,10 @@ private static ManagedChannel buildManagedChannel(DaprApiProtocol apiProtocol) {
118
122
private static DaprClient buildDaprClient (DaprApiProtocol apiProtocol , Channel grpcManagedChannel ) {
119
123
switch (apiProtocol ) {
120
124
case GRPC : return new DaprGrpcClient (DaprGrpc .newStub (grpcManagedChannel ));
121
- case HTTP : return new DaprHttpClient (new DaprHttpBuilder ().build ());
125
+ case HTTP : {
126
+ LOGGER .warn ("HTTP client protocol is deprecated and will be removed in Dapr's Java SDK version 1.10." );
127
+ return new DaprHttpClient (new DaprHttpBuilder ().build ());
128
+ }
122
129
default : throw new IllegalStateException ("Unsupported protocol: " + apiProtocol .name ());
123
130
}
124
131
}
Original file line number Diff line number Diff line change 18
18
19
19
/**
20
20
* DaprClient over HTTP for actor client.
21
- *
21
+ * @deprecated This class will be deleted at SDK release version 1.10.
22
22
* @see DaprHttp
23
23
*/
24
+ @ Deprecated
24
25
class DaprHttpClient implements DaprClient {
25
26
26
27
/**
Original file line number Diff line number Diff line change 15
15
16
16
/**
17
17
* Transport protocol for Dapr's API.
18
+ * @deprecated This class will be deleted at SDK version 1.10.
18
19
*/
20
+ @ Deprecated
19
21
public enum DaprApiProtocol {
20
22
21
23
GRPC ,
Original file line number Diff line number Diff line change 20
20
import io .dapr .v1 .DaprGrpc ;
21
21
import io .grpc .ManagedChannel ;
22
22
import io .grpc .ManagedChannelBuilder ;
23
+ import org .slf4j .Logger ;
24
+ import org .slf4j .LoggerFactory ;
23
25
24
26
import java .io .Closeable ;
25
27
29
31
*/
30
32
public class DaprClientBuilder {
31
33
34
+ private static final Logger LOGGER = LoggerFactory .getLogger (DaprClientBuilder .class );
35
+
32
36
/**
33
37
* Determine if this builder will create GRPC clients instead of HTTP clients.
34
38
*/
@@ -111,6 +115,10 @@ public DaprClientBuilder withStateSerializer(DaprObjectSerializer stateSerialize
111
115
* @throws java.lang.IllegalStateException if any required field is missing
112
116
*/
113
117
public DaprClient build () {
118
+ if (this .apiProtocol == DaprApiProtocol .HTTP ) {
119
+ LOGGER .warn ("HTTP client protocol is deprecated and will be removed in Dapr's Java SDK version 1.10." );
120
+ }
121
+
114
122
if (this .apiProtocol != this .methodInvocationApiProtocol ) {
115
123
return new DaprClientProxy (buildDaprClient (this .apiProtocol ), buildDaprClient (this .methodInvocationApiProtocol ));
116
124
}
Original file line number Diff line number Diff line change 66
66
67
67
/**
68
68
* An adapter for the HTTP Client.
69
- *
69
+ * @deprecated This class will be deleted at SDK release version 1.10.
70
70
* @see io.dapr.client.DaprHttp
71
71
* @see io.dapr.client.DaprClient
72
72
*/
73
+ @ Deprecated
73
74
public class DaprClientHttp extends AbstractDaprClient {
74
75
/**
75
76
* Header for the conditional operation.
Original file line number Diff line number Diff line change 37
37
38
38
/**
39
39
* Class that delegates to other implementations.
40
- *
40
+ * @deprecated This class will be deleted at SDK release version 1.10.
41
41
* @see DaprClient
42
42
* @see DaprClientGrpc
43
43
* @see DaprClientHttp
44
44
*/
45
+ @ Deprecated
45
46
class DaprClientProxy implements DaprClient {
46
47
47
48
/**
Original file line number Diff line number Diff line change 23
23
24
24
/**
25
25
* A builder for the DaprHttp.
26
+ * @deprecated Use {@link DaprClientBuilder} instead, this will be removed in a future release.
26
27
*/
28
+ @ Deprecated
27
29
public class DaprHttpBuilder {
28
30
29
31
/**
Original file line number Diff line number Diff line change @@ -101,7 +101,9 @@ public class Properties {
101
101
102
102
/**
103
103
* Determines if Dapr client will use gRPC or HTTP to talk to Dapr's side car.
104
+ * @deprecated This attribute will be deleted at SDK version 1.10.
104
105
*/
106
+ @ Deprecated
105
107
public static final Property <DaprApiProtocol > API_PROTOCOL = new GenericProperty <>(
106
108
"dapr.api.protocol" ,
107
109
"DAPR_API_PROTOCOL" ,
@@ -110,7 +112,9 @@ public class Properties {
110
112
111
113
/**
112
114
* Determines if Dapr client should use gRPC or HTTP for Dapr's service method invocation APIs.
115
+ * @deprecated This attribute will be deleted at SDK version 1.10.
113
116
*/
117
+ @ Deprecated
114
118
public static final Property <DaprApiProtocol > API_METHOD_INVOCATION_PROTOCOL = new GenericProperty <>(
115
119
"dapr.api.methodInvocation.protocol" ,
116
120
"DAPR_API_METHOD_INVOCATION_PROTOCOL" ,
You can’t perform that action at this time.
0 commit comments