Hi There,
- I am not getting object change notification using pub/sub.
I created topic and sub and associated it to bucket notification as below and
gsutil notification create -f json -t projects/syncdemo/topics/filesync gs://mybucket
I wrote code to receive the notifications as below.
subscriptionName = SubscriptionName.create("syncdemo", "filesyncsub");
MessageReceiver receiver =
new MessageReceiver() {
@Override
public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
System.out.println("Id : " + message.getMessageId());
System.out.println("Received message: " + message.getData());
consumer.ack();
}
};
// Configure max number of messages to be pulled
FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder()
.setMaxOutstandingElementCount(1000l)
.build();
subscriber = Subscriber.defaultBuilder(subscriptionName, receiver)
.setFlowControlSettings(flowControlSettings)
.build();
subscriber.startAsync();
Hi There,
I created topic and sub and associated it to bucket notification as below and
gsutil notification create -f json -t projects/syncdemo/topics/filesync gs://mybucket
I wrote code to receive the notifications as below.