diff --git a/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java b/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java index 6c2d31efe..204867006 100644 --- a/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java +++ b/samples/snippets/src/main/java/pubsub/SubscribeWithAvroSchemaRevisionsExample.java @@ -93,7 +93,7 @@ public static void subscribeWithAvroSchemaRevisionsExample( Schema schema = schemaServiceClient.getSchema(name + "@" + revision); org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(schema.getDefinition()); - reader = new SpecificDatumReader(State.getClassSchema(), avroSchema); + reader = new SpecificDatumReader(avroSchema, State.getClassSchema()); synchronized (revisionReaders) { revisionReaders.put(revision, reader); }