Consume-action doesn't consume from topic

Hi,

I have a service-description that looks like this:

service ConsumeService {
    rpc DispatchData(be.reaktika.domain.Data) returns (google.protobuf.Empty){
        option (akkaserverless.method).eventing.in = {
            topic: "data"
        };
    }
}

The implementation looks like this:

@Action
public class WeatherStationDataConsumeAction {
	@Handler
    public Reply<Empty> dispatchData(Data data) {
		//goeal: dispatch the data from the topic to another action/entity. For now, this only prints something
	}
}

The action is registered in the Main-class with .registerAction.
There are no errors, but when I publish a message on the ‘data’ topic, nothing happens.
I checked these things:

  • The service-account is correct (it is the same that publishes to the topic, which works fine)
  • the messages are succesfully published on the topic (I can see that in the gcp-console).
  • a subscription is (automatically) created with name data_be.reaktika.ConsumeService for the topic data.
  • The messages for that subscriber start to pile-up (unacked-message-count rises): (they are not being consumed)
  • no errors during deployment or runtime.

Any idea what I might be missing?
Thanks!

Do you see the data being read by the consumer?

No, I don’t see the consumer-action being called (there are no logstatements). I also don’t see logs from the constructor of that consumer-action.
But there is a subscriptions created for the topic in google-pub/sub, but the number of unacked-messages increases.
So, no, nothing gets consumed

Can you confirm that you saw message data via the GCP console? The mere presence of messages is not sufficient confirmation. There is a data attribute that needs to be populated.

I was just wrestling with a similar problem. I had a google pubsub client (python) subscribed to my topic and my messages were coming across as:

Message {
  data: b''
  ordering_key: ''
  attributes: {
    "ce-datacontenttype": "application/protobuf",
    "ce-id": "5beeb008-5243-40b2-acc6-5d643cf81ebd",
    "ce-source": "com.example.OrderService",
    "ce-specversion": "1.0",
    "ce-time": "2021-07-30T23:01:29.755092Z",
    "ce-type": "com.example.CustomerOrder"
  }
}

The attributes look good but the empty data slot is the indicator that something was wrong. For me, it was that I was sending across JSON when it should have been protobuf data.

Right now, this is one of the trickiest parts of the product. Troubleshooting is tough and time consuming. I’d be happy to continue this conversation in this thread, as well as having me or someone else jump on a zoom to share in realtime.

Hi Jeremy,

I have left the project alone for about a week since I posted my previous message.
When I saw your message, I sent a request to my app today (without making any changes) to verify, as you asked.
Supprisingly, I noticed in the logs that there were messages being produced to the topic, and also that those messages were being consumed.
I don’t know what happend during the last week (maybe something was updated on the platform), but in any case, it just started spontaniously started working.

I did see the messages in the GCP console, however I didn’t verify the data, so I don’t know if it was the same issue.