Skip to content

Commit 024b8c2

Browse files
authored
Update README.md - how to use request per element mode in Http Sink
1 parent a3eca91 commit 024b8c2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,27 @@ CREATE TABLE http (
266266
#### Single submission mode
267267
In this mode every processed event is submitted as individual HTTP POST/PUT request.
268268

269+
Streaming API:
270+
```java
271+
HttpSink.<String>builder()
272+
.setEndpointUrl("http://example.com/myendpoint")
273+
.setElementConverter(
274+
(s, _context) -> new HttpSinkRequestEntry("POST", s.getBytes(StandardCharsets.UTF_8)))
275+
.setProperty("gid.connector.http.sink.writer.request.mode", "single")
276+
.build();
277+
```
278+
SQL:
279+
```roomsql
280+
CREATE TABLE http (
281+
id bigint,
282+
some_field string
283+
) WITH (
284+
'connector' = 'http-sink',
285+
'url' = 'http://example.com/myendpoint',
286+
'format' = 'json',
287+
'gid.connector.http.sink.writer.request.mode' = 'single'
288+
)
289+
```
269290

270291
#### Http headers
271292
It is possible to set HTTP headers that will be added to HTTP request send by sink connector.

0 commit comments

Comments
 (0)