Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Azure event Hub client library to version 3.3.0 #96

Merged
merged 10 commits into from
Oct 25, 2024

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Oct 22, 2024

Release notes

Updated Azure Event Hub client library to version 3.3.0

What does this PR do?

Updates azure-eventhubs to 3.3.0 and all its dependencies.

  • adapt the instantiation of EventProcessorHost using the EventProcessorHostBuilder instead of the now private constructor
  • updates the mocking in unit tests to respect the switch from constructor to builder.

Why is it important/What is the impact to the user?

Permit to use a newer library.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • run against a real Az EH instance and check it can pull data out of the queue.

How to test this PR locally

gem "logstash-input-azure_event_hubs", :path => "/path/to/logstash-input-azure_event_hubs"

and update with bin/logstash-plugin install --no-verify

  • run Logstash with a pipeline like:
input {
  azure_event_hubs {
    connections => ["Endpoint=sb://<name of the Event Hub>.servicebus.windows.net/;SharedAccessKeyName=test-log;SharedAccessKey=<s3cr3t_1>;EntityPath=test"]
    event_hub_connections => ["Endpoint=sb://<name of the Event Hub>.servicebus.windows.net/;SharedAccessKeyName=eh_policy;SharedAccessKey=<s3cr3t_2>;EntityPath=logstash-event-hub"]
    decorate_events => true
    storage_container => "logstash"
    storage_connection => "DefaultEndpointsProtocol=https;AccountName=<storageaccount>;AccountKey=<s3cr3t_3>;EndpointSuffix=core.windows.net"

  }
}

output {
  stdout{
    codec => rubydebug
  }
}
  • from Azure EbentHub UI send a message and verify it's processed by Logstash without any error like class or method not found.

Related issues

…rocessorHost using the EventProcessorHostBuilder
With version 3 of the library EventProcessorHost cosntructor has been replaced by EventProcessorHost.EventProcessorHostBuilder.
The tests was updated to mock the builder and not the constructor.
@andsel andsel changed the title Updated azure-eventhubs to 3.3.0 adapting the instantiation of EventP… Update Azure event Hub client library to version 3.3.0 Oct 23, 2024
@andsel andsel added the enhancement New feature or request label Oct 23, 2024
@andsel andsel marked this pull request as ready for review October 24, 2024 07:55
Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change needed for the nimbus-jose-jwt dependency, otherwise LGTM

require_jar('com.github.stephenc.jcip', 'jcip-annotations', '1.0-1')
require_jar('com.google.guava', 'guava', '32.0.1-jre')
require_jar('com.nimbusds', 'lang-tag', '1.7')
require_jar('com.nimbusds', 'nimbus-jose-jwt', '9.8.1')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
require_jar('com.nimbusds', 'nimbus-jose-jwt', '9.8.1')
require_jar('com.nimbusds', 'nimbus-jose-jwt', '9.37.2')

build.gradle Outdated Show resolved Hide resolved
@andsel andsel merged commit 6589acd into logstash-plugins:main Oct 25, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants