Class InputDestination
java.lang.Object
org.springframework.cloud.stream.binder.test.InputDestination
Implementation of binder endpoint that represents the source destination (e.g.,
destination from which messages will be received by Processor.INPUT).
You can interact with it by calling
You can interact with it by calling
send(Message) operation.- Author:
- Oleg Zhurakousky
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsend(org.springframework.messaging.Message<?> message) Allows theMessageto be sent to a Binder to be delegated to a default binding destination (e.g., "function-in-0" for cases where you only have a single function with the name 'function').voidAllows theMessageto be sent to a Binder's destination.
This needs a bit of clarification.
-
Constructor Details
-
InputDestination
public InputDestination()
-
-
Method Details
-
send
public void send(org.springframework.messaging.Message<?> message) Allows theMessageto be sent to a Binder to be delegated to a default binding destination (e.g., "function-in-0" for cases where you only have a single function with the name 'function').- Parameters:
message- message to send
-
send
Allows theMessageto be sent to a Binder's destination.
This needs a bit of clarification. Just like with any binder, 'destination' name and 'binding' name are usually the same unless additional configuration is provided. For example; Assume you have a function 'uppercase'. The 'binding' names for this function would be 'uppercase-in-0' (for input) and 'uppercase-out-0' (for output). The 'destination' names would match as well unless you decide to provide something like 'spring.cloud.stream.bindings.uppercase-in-0.destination=upper' at which point the binding names and destination names are different.
So, it is important to remember that since this binder's goal is to emulate real binders and real messaging systems you are sending TO and receiving FROM destination (as if it was real broker destination) and binder will map and delegate what you send to the binder's destination to individual bindings as would the real binder. *// assume the following properties "--spring.cloud.function.definition=uppercase", "--spring.cloud.stream.bindings.uppercase-in-0.destination=upper", "--spring.cloud.stream.bindings.uppercase-out-0.destination=upperout" // send/receive inputDestination.send(message, "upper"); Message<byte[]> resultMessage = outputDestination.receive(1000, "upperout"); // if 'destination' property is not provided for both input and output inputDestination.send(message, "uppercase-in-0"); Message<byte[]> resultMessage = outputDestination.receive(1000, "uppercase-out-0");
- Parameters:
message- message to senddestinationName- the name of the destination
-