-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from suhothayan/master
Make http-call sink to have default on.error behavior & refactor code
- Loading branch information
Showing
20 changed files
with
548 additions
and
603 deletions.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
component/src/main/java/io/siddhi/extension/io/http/sink/ClientConnector.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package io.siddhi.extension.io.http.sink; | ||
|
||
import org.wso2.transport.http.netty.contract.HttpClientConnector; | ||
import org.wso2.transport.http.netty.contract.HttpResponseFuture; | ||
import org.wso2.transport.http.netty.message.HttpCarbonMessage; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Class to have the client connector and related properties | ||
*/ | ||
public class ClientConnector { | ||
|
||
private String publisherURL; | ||
private Map<String, String> httpURLProperties; | ||
private HttpClientConnector httpClientConnector; | ||
|
||
public ClientConnector(String publisherURL, Map<String, String> httpURLProperties, | ||
HttpClientConnector httpClientConnector) { | ||
this.publisherURL = publisherURL; | ||
this.httpURLProperties = httpURLProperties; | ||
this.httpClientConnector = httpClientConnector; | ||
} | ||
|
||
public String getPublisherURL() { | ||
return publisherURL; | ||
} | ||
|
||
public HttpResponseFuture send(HttpCarbonMessage cMessage) { | ||
return httpClientConnector.send(cMessage); | ||
} | ||
|
||
public Map<String, String> getHttpURLProperties() { | ||
return httpURLProperties; | ||
} | ||
|
||
} |
241 changes: 23 additions & 218 deletions
241
component/src/main/java/io/siddhi/extension/io/http/sink/HttpCallSink.java
Large diffs are not rendered by default.
Oops, something went wrong.
408 changes: 186 additions & 222 deletions
408
component/src/main/java/io/siddhi/extension/io/http/sink/HttpSink.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.