Releases: Azure/azure-event-hubs-java
Event Processor Host 2.4.0
com.microsoft.azure.eventprocessorhost
This release consists of Event Processor Host 2.4.0, which works with Java Event Hubs Client version 2.2.0.
Here is the corresponding Maven package: https://www.mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs-eph/2.4.0
2.1.0
Event Processor Host 2.3.0
com.microsoft.azure.eventprocessorhost
This release consists of Event Processor Host 2.3.0, which works with Java Event Hubs Client version 2.1.0.
Here is the corresponding Maven package: https://www.mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs-eph/2.3.0
2.0.0
com.microsoft.azure.eventhubs
Breaking changes
- Move setPrefetchCount API to the ReceiverOptions class and change the default settings for the prefetch. (#410).
- Use ScheduledExecutorService instead of ExecutorService (#411)
Improvements
- Update PartitionReceiver class and add a method that provides an EventPosition which corresponds to an EventData returned last by the receiver (#408)
- Fixes several issues in the reactor related components and improve tracing (#411, #414)
Here's the corresponding Maven package:
https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/2.0.0
Event Processor Host 2.2.0
com.microsoft.azure.eventprocessorhost
This release consists of Event Processor Host 2.2.0, which works with Java Event Hubs Client version 2.0.0.
Here is the corresponding Maven package: https://www.mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs-eph/2.2.0
1.3.0
com.microsoft.azure.eventhubs
Bug fixes
- Fix IO pipe stuck issue due to aggressive timer scheduling. This manifested as receivers freezing with a stack trace showing a thread hung trying to write to the pipe. (#402).
Here's the corresponding Maven package:
https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/1.3.0
Event Processor Host 2.1.0
com.microsoft.azure.eventprocessorhost
This release consists of Event Processor Host 2.1.0, which works with Java Event Hubs Client version 1.3.0.
Bug fixes
- Fixes issues with stuck partitions which are emitting "updating lease for pump" messages in the log. (#401)
Here is the corresponding Maven package: https://www.mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs-eph/2.1.0
1.2.1
com.microsoft.azure.eventhubs
Bug fixes
- Work around an apparent issue in proton-j (in which, on the
ReceivingLink
, duplicate Delivery events are sometimes raised by Reactor and then an IllegalStateException occurs while processing the duplicate event) by ignoring the duplicate events (#391).
Here's the corresponding Maven package:
https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/1.2.1
1.2.0
com.microsoft.azure.eventhubs
New Features
Proxy Support - with Basic Authentication (#378)
Amqp over WebSockets with proxy support is particularly useful when enterprises want to stream data from on-premise to cloud and IT policies restrict all outbound traffic to flow only via a Proxy Server. To send to or receive from Microsoft Azure Event Hubs via proxy server, set the HTTP proxy
settings & set the TransportType
on ConnectionStringBuilder
to AMQP_WEB_SOCKETS
, and you are all set!
Step-1: Set the proxy server settings
Here's more help on setting jdk proxy properties.
// Way 1: set the system-wide http proxy settings; azure-eventhubs library will automatically use them if you use TransportType=AMQP_WEB_SOCKETS
java -Dhttp.proxyHost=ipAddress -Dhttp.proxyPort=8080` ...
or
// Way 2: set the ProxySelector API; which offers the flexibility to select Proxy Server based on the Target URI.
ProxySelector systemDefaultSelector = ProxySelector.getDefault();
ProxySelector.setDefault(new ProxySelector() {
@Override
public List<Proxy> select(URI uri) {
if (uri != null
&& uri.getHost() != null
&& uri.getHost().equalsIgnoreCase("eventhubsnamespace.servicebus.windows.net")) {
LinkedList<Proxy> proxies = new LinkedList<>();
proxies.add(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyIpAddressStr, proxyPort)));
return proxies;
}
// preserve system default selector for the rest
return systemDefaultSelector.select(uri);
}
@Override
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
// trace and follow up on why proxy server is down
}
});
Step-2: Set the Proxy Authentication details
Note: The jdk
setting for disabling authentication schemes (-Djdk.http.auth.tunneling.disabledSchemes
) has NO effect on BasicAuthentication support for this package version. i.e., no matter what the value of the flag -Djdk.http.auth.tunneling.disabledSchemes
is - BasicAuthentication is used. azure-eventhubs package depends on the package, qpid-proton-j-extensions for authenticating with Proxy, and this package doesn't hook into the 'disabledSchemes
jdk` setting.
// if the proxy being used, doesn't need any Authentication - "setting Authenticator" step may be omitted
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
if (this.getRequestorType() == RequestorType.PROXY
&& this.getRequestingScheme().equalsIgnoreCase("http")
&& this.getRequestingHost().equals(proxyIpAddressStr)
&& this.getRequestingPort() == proxyHostPort) {
return new PasswordAuthentication("userName", "password".toCharArray());
}
return super.getPasswordAuthentication();
}
});
Step-3: Configure EventHubClient transport to AmqpWebSockets
connectionStringBuilder.setTransportType(TransportType.AMQP_WEB_SOCKETS);
EventHubClient ehClient = EventHubClient.createSync(connectionStringBuilder.toString()....);
// hereon, this ehClient instance is ready to talk to EventHub service via the proxy server
Bug fixes
Fix EventHub PartitionReceiver.receive()
API behavior on transient errors (#381)
Here's the corresponding Maven package:
https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/1.2.0
http://repo1.maven.org/maven2/com/microsoft/azure/azure-eventhubs/1.2.0/
1.1.0
com.microsoft.azure.eventhubs
New Features
- WebSockets Support (#362)
Amqp over WebSockets is particularly useful when enterprise policies (ex: firewall outbound port rules) restrict traffic on the default Amqp secure port (5671
). To send or receive to Microsoft Azure Event Hubs over websockets - which uses port443
, set theTransportType
onConnectionStringBuilder
, like this:
connectionStringBuilder.setTransportType(TransportType.AmqpWebSockets)
Bug fixes
- Correct the ExceptionContract when request-response channel closes with transient error (#372)
- PartitionReceiver and PartitionSender creation should participate in RetryPolicy (#373)
Here's the corresponding Maven package:
https://mvnrepository.com/artifact/com.microsoft.azure/azure-eventhubs/1.1.0
http://repo1.maven.org/maven2/com/microsoft/azure/azure-eventhubs/1.1.0/