ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

The MQTT service declaration cannot have the `onComplete` method #7272

Open TharmiganK opened 1 month ago

TharmiganK commented 1 month ago

Description:

$Subject

Even though this is support in the service object definition, the compiler plugin is throwing an error when it is used in the service declaration

Steps to reproduce:

Try to compile the following code:

service /api on new mqtt:Listener(mqtt:DEFAULT_URL, "", "") {

    remote function onMessage(mqtt:Message message, mqtt:Caller caller) returns error? {

    }

    remote function onError(mqtt:Error err) returns error? {

    }

    remote function onComplete(mqtt:DeliveryToken token) returns error? {
        // handle the delivery token
    }
}

Affected Versions:

Ballerina SwanLake Update 10(2201.10.x)