Open freeleyjenny opened 5 months ago
Deltio currently doesn’t expose an HTTP-based API (only gRPC).
I wonder if the gcloud CLI uses gRPC, in which case you could use that. You could probably also write a Python or NodeJS script that uses the official PubSub library.
Thank you for the quick response, we will try to use grpcurl requests instead. Am I correct in thinking that Deltio does not support project creation at the moment? What is the default project that is created when the container is spun up?
Any project ID can be used, similar to the official emulator.
Hi,
We have been able to successfully create topics and subscriptions via grpcurl thank you for the help. We are however seeing some unusual behaviour around the response of the emulator when we use a context with timeout or context with cancel when subscribing/receiving and there are no events on the subscription. When we used a different pubsub emulator image in the example below we received a timeout if there were no events on the subscription whereas the deltio image seems to not respond or time out as expected. Under the hood cloudeventsConnector uses a google cloudevents client StartReceiver() function. Do you know how this emulator handles context that times out or is cancelled?
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
ctx = subscriberContext.WithLogger(ctx, zap.NewNop().Sugar())
log.Print("Clearing old events")
defer cancelFunc()
var wg sync.WaitGroup
wg.Add(2)
go func() {
defer wg.Done()
err := runner.cloudEventsConnector.Subscribe(ctx, func(ctx context.Context, event event.Event) protocol.Result {
return nil
})
if err != nil {
log.Fatal("ClearEvents failed", err)
}
}()
Some questions:
CANCELLED
status?We're consuming Deltio via a .NET client and cancellation works fine there.
Hi, We are hoping to move to using this docker image for our pubsub emulator but we have a requirement to do the creation via our docker compose file. With the previous image we were using we were creating the topics and subscriptions via curl command according to the gcloud pubsub api as follows: curl -v -s -X PUT pubsub:8085/v1/settlement-topic curl -v -s -X PUT pubsub:8085/v1/testproject/settlement-project/subscriptions/settlement-subscription \ -H 'content-type: application/json' \ --data '{"topic":"projects/testproject/topics/settlement-topic"}'
These requests do not seem to be working with this image. Could you please advise if there are changes required to the requests or if it is possible to setup the pubsub emulator in this way with this image?