@Override public Coder<PubsubMessage> getOutputCoder() { return outer.getNeedsAttributes() ? PubsubMessageWithAttributesCoder.of() : PubsubMessagePayloadOnlyCoder.of(); }
/** * Returns A {@link PTransform} that continuously reads from a Google Cloud Pub/Sub stream. The * messages will only contain a {@link PubsubMessage#getPayload() payload}, but no {@link * PubsubMessage#getAttributeMap() attributes}. */ public static Read<PubsubMessage> readMessages() { return new AutoValue_PubsubIO_Read.Builder<PubsubMessage>() .setCoder(PubsubMessagePayloadOnlyCoder.of()) .setParseFn(new IdentityMessageFn()) .setNeedsAttributes(false) .build(); }