making changes to adapter, including tests and documentation
This commit is contained in:
@@ -136,6 +136,28 @@ Invoke the HTTP function:
|
||||
curl https://REGION-PROJECT_ID.cloudfunctions.net/function-sample-gcp-http -d "hello"
|
||||
----
|
||||
|
||||
|
||||
Setting custom HTTP statusCode:
|
||||
|
||||
----
|
||||
Users can specify the response statusCode that they want to set by wrapping "statusCode" in headers.
|
||||
----
|
||||
|
||||
[source, java]
|
||||
----
|
||||
@Bean
|
||||
public Function<String, Message<String>> function() {
|
||||
|
||||
String payload = "hello";
|
||||
|
||||
Message<String> message = MessageBuilder.withPayload(payload).setHeader("statusCode", 404).build();
|
||||
|
||||
return input -> message;
|
||||
};
|
||||
----
|
||||
|
||||
|
||||
|
||||
==== Background Functions
|
||||
|
||||
Google Cloud Functions also supports deploying https://cloud.google.com/functions/docs/writing/background[Background Functions] which are invoked indirectly in response to an event, such as a message on a https://cloud.google.com/pubsub[Cloud Pub/Sub] topic, a change in a https://cloud.google.com/storage[Cloud Storage] bucket, or a https://firebase.google.com/[Firebase] event.
|
||||
|
||||
Reference in New Issue
Block a user