Azure/azure-functions-java-library

Getting error of attempt failed for EventHub Trigger. Kindly help me in solving this issue.

yashaswi90 opened this issue · 1 comments

[2022-07-26T05:27:56.274Z] EventProcessorHost error (Action='Retrieving list of partition identifiers from a Consumer Client.', HostName='b561da97-9dbf-4eff-bf6a-639cff0002b1', Partiti
onId='').
[2022-07-26T05:27:56.274Z] The listener for function 'Functions.CustomEventTrigger' was unable to start.
[2022-07-26T05:27:56.276Z] System.Private.CoreLib: An attempt was made to access a socket in a way forbidden by its access permissions.
[2022-07-26T05:27:56.277Z] The listener for function 'Functions.CustomEventTrigger' was unable to start. System.Private.CoreLib: One or more errors occurred. (An attempt was made to ac
cess a socket in a way forbidden by its access permissions.) (An attempt was made to access a socket in a way forbidden by its access permissions.). System.Private.CoreLib: An attempt
was made to access a socket in a way forbidden by its access permissions.

host.json
{ "version": "2.0", "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[3.3.0, 4.0.0)" } }

`package org.datareplication.functions;

import com.microsoft.azure.functions.annotation.;
import com.microsoft.azure.functions.
;
import java.util.*;

/**

  • Azure Functions with Event Hub trigger.
    /
    public class CustomEventTrigger {
    /
    *
    • This function will be invoked when an event is received from Event Hub.
      */
      @functionName("CustomEventTrigger")
      public void run(
      @EventHubTrigger(name = "message", eventHubName = "myeventhub",
      connection = "AzureEventHubConnectionString",
      consumerGroup = "$Default",
      cardinality = Cardinality.MANY) String message,
      final ExecutionContext context
      ) {
      context.getLogger().info("Java Event Hub trigger function executed.");
      context.getLogger().info("Length:" + message);
      // message.forEach(singleMessage -> context.getLogger().info(singleMessage));
      }
      }
      `

From the exception info, it seems related to your configuration. Please let me know if you still have this issue. Thanks.