-
Bug
-
Resolution: Done
-
Major
-
1.7.0.Final
-
None
-
False
-
False
-
-
When trying to provide a custom PubSub Publisher to PubSubChangeConsumer via @CustomConsumerBuilder injection point, the projectId property of the change consumer is not being set. Because of this return once a custom publisher is found, the projectId is null since it's being set below, here
It's actually failing here since it's trying to create a TopicName for a null project.
One way to fix this is to move the lines of code where the project is being set above the if that checks customPublisherBuilder.isResolvable(). Like this
@PostConstruct void connect() { final Config config = ConfigProvider.getConfig(); projectId = config.getOptionalValue(PROP_PROJECT_ID, String.class).orElse(ServiceOptions.getDefaultProjectId()); ... // if statement }
Another way is to app new properties to configure the default Publisher with things like batch size/number of messages inside a batch, but this one is going to be difficult.