Skip to content

Provide a way to configure the HTTP Listener configurations in the Async API generated listeners #7493

@TharmiganK

Description

@TharmiganK

Current Limitation

The listeners created from Async API has the following init function:

function init(ListenerConfig listenerConfig , int|http:Listener listenOn) {}

The ListenerConfig record only has the trigger specific configurations, and if you want to configure the HTTP listener config then you need to pass the HTTP listener as the listenOn parameter(this requires a HTTP listener defintion). There is no way to simply give the port for listenOn and add the HTTP configurations separately.

Suggested Improvement

In case of GraphQL listener, we can pass the HTTP listener configurations as part of GraphQL listener configurations:

isolated function init(int|http:Listener listenTo, *ListenerConfiguration configuration) { }
# Provides a set of configurations for configure the underlying HTTP listener of the GraphQL listener.
public type ListenerConfiguration record {|
    *http:ListenerConfiguration;
|};

This approach is more preferable than the other

Version

Ballerina SwanLake Update 11

Metadata

Metadata

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions