public static Coder<PubsubMessage> of(TypeDescriptor<PubsubMessage> ignored) { return of(); }
public static PubsubMessageWithAttributesCoder of() { return new PubsubMessageWithAttributesCoder(); }
@Override public PubsubMessage decode(InputStream inStream) throws IOException { return decode(inStream, Context.NESTED); }
@Override public void encode(PubsubMessage value, OutputStream outStream) throws IOException { encode(value, outStream, Context.NESTED); }
@Override public List<CoderProvider> getCoderProviders() { return ImmutableList.of( CoderProviders.forCoder( TypeDescriptor.of(PubsubMessage.class), PubsubMessageWithAttributesCoder.of())); } }
@Override public PCollection<PubsubMessage> expand(PBegin input) { return PCollection.createPrimitiveOutputInternal( input.getPipeline(), WindowingStrategy.globalDefault(), IsBounded.UNBOUNDED, new PubsubMessageWithAttributesCoder()); }
@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 contain both a {@link PubsubMessage#getPayload() payload} and {@link * PubsubMessage#getAttributeMap() attributes}. */ public static Read<PubsubMessage> readMessagesWithAttributes() { return new AutoValue_PubsubIO_Read.Builder<PubsubMessage>() .setCoder(PubsubMessageWithAttributesCoder.of()) .setParseFn(new IdentityMessageFn()) .setNeedsAttributes(true) .build(); }
FailsafeElementCoder.of(PubsubMessageWithAttributesCoder.of(), StringUtf8Coder.of());
"waitForDlq", dlqSignal.signalSuccessWhen( PubsubMessageWithAttributesCoder.of(), dlqMessages -> containsAll(dlqMessages, message(ts(4), "{ - }"), message(ts(5), "{ + }"))));