Azure / Azure/azure-rest-api-specs-examples

Event Grid Manager hangs creating event topic subscription

Open
#2,197 1 comment 0 reactions 1 assignee Claimed by @XiaofeiCao View on GitHub
customer-reported needs-triage question
Dominant language
No language data
Stars
40
Forks
23
Avg merge
23h 36m
Merged PRs (30d)
172

Description

### Library name and version

com.azure.resourcemanager:azure-resourcemanager-eventgrid:1.2.0-beta.3

### Sample Issue Type

- [X] Sample not working
- [X] Sample missing
- [ ] Do not understand sample

### Issue details

I'm trying to create a subscription using the EventGridManager, if the webhook endpoint for the destination is good everything works, but if the endpoint is not a valid webhook, the service hangs indefinitely. Is there a way to set a timeout? so that the service doesn't hangs, as right now I need to interrupt the thread.

Thanks

```java
EventSubscription eventSubscription = manager.topicEventSubscriptions()
.define(eventSubscriptionName)
.withExistingTopic(resourceGroupName, eventGridTopicName)
.withDestination(destination)
.create();
```

### Expected behavior

If the endpoint is not valid a timeout a default timeout happens and fails, and this timeout can be set from the create method.

### Actual behavior

On wrong endpoint the thread hangs indefinitely

### Reproduction Steps

Try to create a subscription using "www.microsoft.com" as endpoint

```java
var url = URI.create("www.microsoft.com");
WebhookEventSubscriptionDestination destination = new WebhookEventSubscriptionDestination()
.withEndpointUrl(url.toString());

EventSubscription eventSubscription = manager.topicEventSubscriptions()
.define(eventSubscriptionName)
.withExistingTopic(resourceGroupName, eventGridTopicName)
.withDestination(destination)
.create();
```

### Environment

Java: 17
Windows 11
Maven 3.8.7
Intellij Idea 2021.3.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.