making changes to adapter, including tests and documentation

This commit is contained in:
Deepankar Dixit
2022-05-25 10:22:29 -04:00
parent 11666058ad
commit eecb373d50
3 changed files with 90 additions and 9 deletions

View File

@@ -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.