I am trying to use Fabric Java SDK to perform chaincode related operations. For this purpose, I wish to make use of the new Channel Event Hub functionality for listening to different events, mainly Blocks Events and Transaction Events.
I know how to perform these tasks using Fabric Node SDK by creating an instance of `channelEventHub` class. But all the examples related to Java SDK mainly use event hub service by creating the event hub object as follows:
EventHub eventHub = client.newEventHub("eventhub01", "grpcs://localhost:7053", props);
Which I feel is making use of old technique of connecting to peer node for listening to events (please correct me if this understanding is wrong). I wish to make use of the feature identical to channel event hub service in Node SDK as I am making use of Kubernetes to run my nodes and only communication that can be made to peers is over port `443` (being redirected to `7051`).
1. Do we have an example where we make use of channel event hub service in Java SDK? I think it should properly documented as good as the Node SDK documentation.
2. I am understanding that the new channel event hub service would also connect to one of the peers on the channel because in Node SDK I find the function signature as follows: `newChannelEventHub(peer)`
Now, is this understanding correct?
- If yes, then in Java SDK is it correct to use `grpcs://<peerEndpoint>:443` for creating event hub connection, where `443` will be directed to internal port `7051`?
- If no, then how to perform channel-based event hub service in Java SDK?