Competing consumers on the JVM?

Hello,

is there a way to use competing consumers from a JVM client?

I was looking at https://github.com/EventStore/EventStore.JVM but I think competing consumers are not supported there yet.

Otherwise, there’s the HTTP API, but I can’t find docs on how to create a persistent subscription? (I’m looking at http://docs.geteventstore.com/http-api/3.0.3/reading-streams/) Anyway I suppose the HTTP API would have some performance hit because of all the XML.

Or is there some other way?

Thanks,

Adam

The competing consumer http api isn't released yet but you can take a
look at it here.
https://github.com/EventStore/EventStore/tree/chrisgreghttp its
basically there but has not been tested/merged into dev. You are right
in that it will also be slower than the TCP version if for no other
reason than its a pull model where as TCP is a push model

The stuff for creating etc IS there already over http see:

protected override void SubscribeCore(IHttpService service)
{
Register(service, "/subscriptions/{stream}/{subscription}",
HttpMethod.Get, GetSubscriptionInfo, Codec.NoCodecs, DefaultCodecs);
Register(service, "/subscriptions/{stream}", HttpMethod.Get,
GetSubscriptionInfoForStream, Codec.NoCodecs, DefaultCodecs);
Register(service, "/subscriptions", HttpMethod.Get,
GetAllSubscriptionInfo, Codec.NoCodecs, DefaultCodecs);
Register(service, "/subscriptions/{stream}/{subscription}",
HttpMethod.Put, PutSubscription, DefaultCodecs, DefaultCodecs);
Register(service, "/subscriptions/{stream}/{subscription}",
HttpMethod.Post, PostSubscription, DefaultCodecs, DefaultCodecs);
RegisterUrlBased(service, "/subscriptions/{stream}/{subscription}",
HttpMethod.Delete, DeleteSubscription);
RegisterUrlBased(service,
"/subscriptions/{stream}/{subscription}/replayParked",
HttpMethod.Post, ReplayParkedMessages);
}

the jvm api does not yet have support but this is underway it is not a
huge amount of work...

Thanks! So I guess for a performance test the best bet would be using the .NET client :slight_smile:

As for HTTP being pull, I thought that maybe you are streaming the feed incrementally to the client as new events arrive (like in comet), but I didn’t read how this works exactly in ES.

Adam

We could do something like that. As of now we have kept an atom style
format (its in that branch)