Created
March 24, 2018 05:37
-
-
Save MaryamZi/782c00cfed09982559e7210509f26311 to your computer and use it in GitHub Desktop.
Sample using Ballerina WebSub Hub client endpoint to unsubscribe.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/io; | |
import ballerina/net.http; | |
import ballerina/net.websub; | |
endpoint websub:HubClientEndpoint websubHubClientEP { | |
uri: "http://localhost:9999/websub/hub" | |
}; | |
function main (string [] args) { | |
websub:SubscriptionChangeRequest subscriptionChangeRequest = {topic:"http://www.websubpubtopic.com", callback:"http://localhost:8181/websub"}; | |
var subscriptionChangeResponse = websubHubClientEP -> unsubscribe(subscriptionChangeRequest); | |
match (subscriptionChangeResponse) { | |
websub:SubscriptionChangeResponse subs => io:println(“Successful”); | |
websub:WebSubError err => io:println(“Unsuccessful”); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment