Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit d2bc6d5

Browse files
committed
FABJ-399 Remove eventhub code
Change-Id: Id7086a1e0223a6dff60e97f577a381a1705f4b40 Signed-off-by: rickr <cr22rc@gmail.com>
1 parent 2080902 commit d2bc6d5

40 files changed

+326
-1430
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,14 @@ No.
271271
### Firewalls, load balancers, network proxies
272272

273273
These can sometimes silently kill a network connections and prevent them from auto reconnecting. To fix this look at
274-
adding to Peers, EventHub's and Orderer's connection properties:
274+
adding to Peers and Orderer's connection properties:
275275
`grpc.NettyChannelBuilderOption.keepAliveTime`, `grpc.NettyChannelBuilderOption.keepAliveTimeout`,
276276
`grpc.NettyChannelBuilderOption.keepAliveWithoutCalls`. Examples of this are in End2endIT.java
277277

278278
### grpc message frame size exceeds maximum
279279

280280
The message being returned from the fabric server is too large for the default grpc frame size.
281-
On the Peer, Orderer, orEventHub add the property `grpc.NettyChannelBuilderOption.maxInboundMessageSize`
281+
On the Peer or Orderer add the property `grpc.NettyChannelBuilderOption.maxInboundMessageSize`
282282
See [End2endIT's constructChannel](https://github.com/hyperledger/fabric-sdk-java/blob/b649868113e969d851720c972f660114b64247bc/src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java#L846)
283283

284284

config.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
#org.hyperledger.fabric.sdk.orderer_retry.wait_time=200
1414
## The time the peer event registration waits for first failure in ms
1515
#org.hyperledger.fabric.sdk.peer.eventRegistration.wait_time=5000
16-
## The time the event hub waits to reconnect in ms
17-
#EVENTHUB_CONNECTION_WAIT_TIME=5000
18-
## The number of unsuccessful attempts by the eventhub to reconnect before another warning is issued. Set to -1 for none.
19-
#EVENTHUB_RECONNECTION_WARNING_RATE=50
2016
## The number of unsuccessful attempts by the peer eventing service to reconnect before another warning is issued. Set to -1 for none.
2117
#PEER_EVENT_RECONNECTION_WARNING_RATE=50
2218
## The time the peer eventing service wait to retry to connect in ms.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
<plugin>
280280
<groupId>org.xolstice.maven.plugins</groupId>
281281
<artifactId>protobuf-maven-plugin</artifactId>
282-
<version>0.5.0</version>
282+
<version>0.6.1</version>
283283
<configuration>
284284
<!--
285285
The version of protoc must match protobuf-java. If you don't depend on

src/main/java/org/hyperledger/fabric/sdk/BlockEvent.java

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.google.protobuf.InvalidProtocolBufferException;
2121
import org.hyperledger.fabric.protos.common.Common.Block;
2222
import org.hyperledger.fabric.protos.peer.PeerEvents;
23-
import org.hyperledger.fabric.protos.peer.PeerEvents.Event;
2423
import org.hyperledger.fabric.sdk.exception.InvalidProtocolBufferRuntimeException;
2524

2625
/**
@@ -29,70 +28,22 @@
2928
* @see Block
3029
*/
3130
public class BlockEvent extends BlockInfo {
32-
// private static final Log logger = LogFactory.getLog(BlockEvent.class);
33-
34-
private final EventHub eventHub;
3531
private final Peer peer;
36-
private final Event event;
37-
38-
/**
39-
* creates a BlockEvent object by parsing the input Block and retrieving its constituent Transactions
40-
*
41-
* @param eventHub a Hyperledger Fabric Block message
42-
* @throws InvalidProtocolBufferException
43-
* @see Block
44-
*/
45-
BlockEvent(EventHub eventHub, Event event) throws InvalidProtocolBufferException {
46-
super(event.getBlock());
47-
this.eventHub = eventHub;
48-
this.peer = null;
49-
this.event = event;
50-
}
5132

5233
BlockEvent(Peer peer, PeerEvents.DeliverResponse resp) {
5334
super(resp);
54-
eventHub = null;
5535
this.peer = peer;
56-
this.event = null;
57-
58-
}
59-
60-
/**
61-
* Get the Event Hub that received the event.
62-
*
63-
* @return an Event Hub. Maybe null if new peer eventing services is being used.
64-
* @deprecated Use new peer eventing services
65-
*/
66-
public EventHub getEventHub() {
67-
return eventHub;
6836
}
6937

7038
/**
7139
* The Peer that received this event.
7240
*
73-
* @return Peer that received this event. Maybe null if source is legacy event hub.
41+
* @return Peer that received this event
7442
*/
7543
public Peer getPeer() {
7644
return peer;
7745
}
7846

79-
// /**
80-
// * Raw proto buff event.
81-
// *
82-
// * @return Return raw protobuf event.
83-
// */
84-
//
85-
// public Event getEvent() {
86-
// return event;
87-
// }
88-
89-
boolean isBlockEvent() {
90-
if (peer != null) {
91-
return true; //peer always returns Block type events;
92-
}
93-
94-
return event != null && event.getEventCase() == PeerEvents.Event.EventCase.BLOCK;
95-
}
9647

9748
TransactionEvent getTransactionEvent(int index) throws InvalidProtocolBufferException {
9849
TransactionEvent ret = null;
@@ -130,22 +81,10 @@ public BlockEvent getBlockEvent() {
13081

13182
}
13283

133-
/**
134-
* The event hub that received this event.
135-
*
136-
* @return May return null if peer eventing service detected the event.
137-
* @deprecated use new peer eventing services {@link #getPeer()}
138-
*/
139-
140-
public EventHub getEventHub() {
141-
142-
return BlockEvent.this.getEventHub();
143-
}
144-
14584
/**
14685
* The peer that received this event.
14786
*
148-
* @return May return null if deprecated eventhubs are still being used, otherwise return the peer.
87+
* @return return peer producing the event.
14988
*/
15089

15190
public Peer getPeer() {

src/main/java/org/hyperledger/fabric/sdk/BlockInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ public String getChaincodeIDVersion() {
650650
}
651651

652652
/**
653-
* Get read write set for this transaction. Will return null on for Eventhub events.
654-
* For eventhub events find the block by block number to get read write set if needed.
653+
* Get read write set for this transaction. Will return null on for peer events.
654+
* For peer events find the block by block number to get read write set if needed.
655655
*
656656
* @return Read write set.
657657
*/

0 commit comments

Comments
 (0)