@@ -374,7 +374,7 @@ public class FunctionConfiguration {
|
||||
Object source = bd.getSource();
|
||||
if (source instanceof MethodMetadata methodMetadata) {
|
||||
Class<?> factory = ClassUtils.resolveClassName(methodMetadata.getDeclaringClassName(), null);
|
||||
Class<?>[] params = FunctionContextUtils.getParamTypesFromBeanDefinitionFactory(factory, (RootBeanDefinition) bd);
|
||||
Class<?>[] params = FunctionContextUtils.getParamTypesFromBeanDefinitionFactory(factory, (RootBeanDefinition) bd, methodMetadata.getMethodName());
|
||||
factoryMethod = ReflectionUtils.findMethod(factory, methodMetadata.getMethodName(), params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ Once enabled `RoutingFunction` will be bound to input destination
|
||||
receiving all the messages and route them to other functions based on the provided instruction.
|
||||
|
||||
IMPORTANT: For the purposes of binding the name of the routing destination is `functionRouter-in-0`
|
||||
(see RoutingFunction.FUNCTION_NAME and binding naming convention <<Functional binding names>>).
|
||||
(see RoutingFunction.FUNCTION_NAME and binding naming convention xref:spring-cloud-stream/functional-binding-names.adoc[Functional Binding Names]).
|
||||
|
||||
Instruction could be provided with individual messages as well as application properties.
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
[[explicit-binding-creation]]
|
||||
= Explicit binding creation
|
||||
|
||||
This section describes declarative way of creating bindings explicitly. The framework also provides for programmatic way of creating bindings. For more
|
||||
information please see xref:spring-cloud-stream/binding_visualization_control.adoc#_define_new_and_manage_existing_bindings[Define new and manage existing bindings]
|
||||
|
||||
In the previous section we explained how bindings are created implicitly driven by the names of `Function`, `Supplier` or `Consumer` beans provided by your application.
|
||||
However, there are times when you may need to create binding explicitly where bindings are not tied to any function. This is typically done to
|
||||
support integrations with other frameworks via `StreamBridge`.
|
||||
|
||||
@@ -282,7 +282,7 @@ Here we autowire a `StreamBridge` bean which allows us to send data to an output
|
||||
bridging non-stream application with spring-cloud-stream. Note that preceding example does not have any
|
||||
source functions defined (e.g., Supplier bean) leaving the framework with no trigger to create source bindings in advance, which would be typical for cases where configuration contains function beans. And that is fine, since `StreamBridge` will initiate creation of output bindings (as well as
|
||||
destination auto-provisioning if necessary) for non existing bindings on the first call to its `send(..)` operation caching it for
|
||||
subsequent reuse (see <<StreamBridge and Dynamic Destinations>> for more details).
|
||||
subsequent reuse (see xref:spring-cloud-stream/producing-and-consuming-messages.adoc#streambridge-and-dynamic-destinations[StreamBridge and Dynamic Destinations] for more details).
|
||||
|
||||
However, if you want to pre-create an output binding at the initialization (startup) time you can benefit from `spring.cloud.stream.output-bindings` property where you can declare the name of your sources.
|
||||
The provided name will be used as a trigger to create a source binding.
|
||||
@@ -904,7 +904,7 @@ public class FunctionSampleSpringIntegrationApplication {
|
||||
For those who are familiar with SI you can see we define a bean of type `IntegrationFlow` where we
|
||||
declare an integration flow that we want to expose as a `Function<String, String>` (using SI DSL) called `uppercase`.
|
||||
The `MessageFunction` interface lets us explicitly declare the type of the inputs and outputs for proper type conversion.
|
||||
See <<Content Type Negotiation>> section for more on type conversion.
|
||||
See xref:spring-cloud-stream/content-type.adoc[Content Type Negotiation] section for more on type conversion.
|
||||
|
||||
To receive raw input you can use `from(Function.class, ...)`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user