Skip to content

Cloud Function Java Background Function Support #314

@wko27

Description

@wko27

We are using the relatively recent Java 11 Cloud Functions and following the quickstart tutorials.

Having used this PubSub library previously, I assumed that the following two libraries played well with each other:

<dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-pubsub</artifactId>
      <version>1.108.1</version>
    </dependency>
<dependency>
      <groupId>com.google.cloud.functions</groupId>
      <artifactId>functions-framework-api</artifactId>
      <version>1.0.1</version>
      <scope>provided</scope>
    </dependency>

This does NOT seem to be the case, i.e. the BackgroundFunction type parameter PubSubMessage MUST be a simple POJO and can not be the com.google.pubsub.v1.PubsubMessage class.

We were able to successfully deploy cloud functions with the type signature BackgroundFunction but found runtime failures where the PubsubMessage's field variables were not populated.

This is both a documentation request to clarify that this library should NOT be used with the new Java Cloud functions library, and/or a feature request to add support so that the two libraries are indeed compatible.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/java-pubsub API.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions