Skip to content

Commit

Permalink
Merge branch 'master' into enh_external_hosts
Browse files Browse the repository at this point in the history
# Conflicts:
#	cluster-api/src/main/java/io/scalecube/cluster/Cluster.java
#	cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java
#	examples/src/main/java/io/scalecube/examples/MessagingExample.java
#	examples/src/main/java/io/scalecube/examples/WebsocketMessagingExample.java
  • Loading branch information
artem-v committed Aug 31, 2023
2 parents 2409325 + 036fd61 commit d8f1621
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 256 deletions.
51 changes: 0 additions & 51 deletions cluster-api/src/main/java/io/scalecube/cluster/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,6 @@ public interface Cluster {
*/
List<Address> addresses();

/**
* Send a msg from this member (src) to target member (specified in parameters).
*
* @param member target member
* @param message msg
* @return promise telling success or failure
*/
Mono<Void> send(Member member, Message message);

/**
* Send a msg from this member (src) to target member (specified in parameters).
*
* @param address target address
* @param message msg
* @return promise telling success or failure
*/
Mono<Void> send(Address address, Message message);

/**
* Send a msg from this member (src) to target member (specified in parameters).
*
* @param addresses target addresses
* @param message msg
* @return promise telling success or failure
*/
Mono<Void> send(List<Address> addresses, Message message);

/**
* Sends message to the given address. It will issue connect in case if no transport channel by
* given transport {@code address} exists already. Send is an async operation and expecting a
* response by a provided correlationId and sender address of the caller.
*
* @param address address where message will be sent
* @param request to send message must contain correlctionId and sender to handle reply.
* @return promise which will be completed with result of sending (message or exception)
* @throws IllegalArgumentException if {@code message} or {@code address} is null
*/
Mono<Message> requestResponse(Address address, Message request);

/**
* Sends message to the given address. It will issue connect in case if no transport channel by
* given transport {@code address} exists already. Send is an async operation and expecting a
* response by a provided correlationId and sender address of the caller.
*
* @param member where message will be sent
* @param request to send message must contain correlctionId and sender to handle reply.
* @return promise which will be completed with result of sending (message or exception)
* @throws IllegalArgumentException if {@code message} or {@code address} is null
*/
Mono<Message> requestResponse(Member member, Message request);

/**
* Spreads given message between cluster members using gossiping protocol.
*
Expand Down
25 changes: 0 additions & 25 deletions cluster/src/main/java/io/scalecube/cluster/ClusterImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,31 +402,6 @@ public List<Address> addresses() {
return member().addresses();
}

@Override
public Mono<Void> send(Member member, Message message) {
return TransportWrapper.send(transport, member.addresses(), message);
}

@Override
public Mono<Void> send(Address address, Message message) {
return transport.send(address, message);
}

@Override
public Mono<Void> send(List<Address> addresses, Message message) {
return TransportWrapper.send(transport, addresses, message);
}

@Override
public Mono<Message> requestResponse(Address address, Message request) {
return transport.requestResponse(address, request);
}

@Override
public Mono<Message> requestResponse(Member member, Message request) {
return TransportWrapper.requestResponse(transport, member.addresses(), request);
}

@Override
public Mono<String> spreadGossip(Message message) {
return gossip.spread(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.scalecube.transport.netty.tcp.TcpTransportFactory;
import java.util.Collections;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

/**
* Using Cluster metadata: metadata is set of custom parameters that may be used by application
Expand Down Expand Up @@ -49,18 +48,5 @@ public void onMessage(Message message) {

System.err.println("### joeMemberOptional: " + joeMemberOptional);
System.err.println("### joeMetadata: " + alice.metadata(joeMemberOptional.get()));

// Send hello to Joe
joeMemberOptional.ifPresent(
member ->
alice
.send(member, Message.withData("Hello Joe").build())
.subscribe(
null,
ex -> {
// no-op
}));

TimeUnit.SECONDS.sleep(3);
}
}
84 changes: 0 additions & 84 deletions examples/src/main/java/io/scalecube/examples/MessagingExample.java

This file was deleted.

This file was deleted.

0 comments on commit d8f1621

Please sign in to comment.