You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "featzhang (via GitHub)" <gi...@apache.org> on 2026/03/11 12:43:19 UTC
[PR] [connector-http] Improve README with SQL examples [flink-connector-http]
featzhang opened a new pull request, #30:
URL: https://github.com/apache/flink-connector-http/pull/30
## What is the purpose of the change
The current README lacks practical usage examples, making it difficult for new users to quickly understand how to configure and use the HTTP connector.
This PR improves the README by adding a **Quick Start** section that covers the most common connector usage patterns.
## Brief change log
- Add SQL example for HTTP Sink connector (`CREATE TABLE` + `INSERT INTO`)
- Add SQL example for HTTP Lookup Source connector (temporal join pattern)
- Add DataStream API (Java) example for `HttpSink`
- Add a common configuration options table with key properties and descriptions
## Verifying this change
This is a documentation-only change. Verification is done by reviewing:
- SQL syntax correctness against the existing connector options
- Java API usage matches the public `HttpSink` builder API
- Configuration keys match those defined in `HttpConnectorConfigConstants` and `HttpLookupConnectorOptions`
## Does this pull request potentially affect one of the following areas?
- **Dependencies**: No
- **Performance**: No
- **Security**: No
- **Breaking changes**: No
## Documentation
This PR is itself a documentation improvement. All changes are in `README.md`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#discussion_r2946001010
##########
docs/content/docs/connectors/table/http.md:
##########
@@ -73,6 +73,119 @@ The HTTP source connector supports [Lookup Joins](https://nightlies.apache.org/f
* [Logging the HTTP content](#logging-the-http-content)
* [Restrictions at this time](#restrictions-at-this-time)
<!-- TOC -->
+## Quick Start
+
+This guide provides quick examples to get started with the HTTP connector.
+
+### SQL Example — HTTP Sink
+
+Use the HTTP Sink connector to write Flink records to an external HTTP endpoint via SQL:
+
+```sql
+CREATE TABLE http_sink (
+ id BIGINT,
+ name STRING,
+ status STRING
+) WITH (
+ 'connector' = 'http-sink',
+ 'url' = 'https://api.example.com/events',
+ 'format' = 'json',
+ 'insert-method' = 'POST'
+);
+
+INSERT INTO http_sink SELECT id, name, status FROM source_table;
+```
+
+Note: Flink SQL uses single quotes for string literals in WITH clause options.
+
+### SQL Example — HTTP Lookup Source
+
+Use the HTTP Lookup connector to enrich a stream with data from an external HTTP API:
+
+```sql
+-- Define the HTTP lookup table
+CREATE TABLE http_lookup (
+ id STRING,
+ payload STRING
+) WITH (
+ 'connector' = 'rest-lookup',
+ 'url' = 'https://api.example.com/data',
+ 'format' = 'json',
+ 'lookup-method' = 'GET'
+);
+
+-- Enrich a stream using a lookup join
+SELECT s.event_id, h.payload
+FROM stream_table AS s
+JOIN http_lookup FOR SYSTEM_TIME AS OF s.proc_time AS h
+ ON s.event_id = h.id;
+```
+
+### DataStream API Example — HTTP Sink
+
+Use the HTTP Sink connector in the Flink DataStream API:
+
+```java
+import org.apache.flink.connector.http.HttpSink;
+import org.apache.flink.connector.http.sink.HttpSinkRequestEntry;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.streaming.api.datastream.DataStream;
+
+import java.nio.charset.StandardCharsets;
+
+public class HttpSinkExample {
+ public static void main(String[] args) throws Exception {
+ StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+
+ // Create a simple source stream
+ DataStream<String> sourceStream = env.fromElements("event1", "event2", "event3");
+
+ // Configure the HTTP sink
+ HttpSink<String> httpSink = HttpSink.<String>builder()
+ .setEndpointUrl("https://api.example.com/events")
+ .setElementConverter(
+ (element, context) ->
+ new HttpSinkRequestEntry("POST", element.getBytes(StandardCharsets.UTF_8)))
+ .build();
+
+ // Send the source stream to the HTTP sink
+ sourceStream.sinkTo(httpSink);
+
+ // Execute the Flink job
+ env.execute("HTTP Sink Example");
+ }
+}
+```
+
+### Common Configuration Options
Review Comment:
We already document these config options - I do not think we should have them twice as this could lead to them getting out of step.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39361][connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#issuecomment-4290375374
Hi @davidradl,
Thank you for the detailed review! I have addressed all the issues you raised in the commits pushed on **March 31, 2026**:
### ✅ Issues Fixed:
1. **Connector name for HTTP Sink** ([2118b39](https://github.com/apache/flink-connector-http/pull/30/commits/2118b39), [db7e3df](https://github.com/apache/flink-connector-http/pull/30/commits/db7e3df))
- Fixed: `'http-sink'` → `'http-async-sink'`
- Matches `HttpDynamicTableSinkFactory.IDENTIFIER` in the code
2. **Connector name for HTTP Lookup Source** (already correct in [7698996](https://github.com/apache/flink-connector-http/pull/30/commits/7698996))
- Using: `'connector' = 'http'`
- Matches `HttpLookupTableSourceFactory.IDENTIFIER` in the code
3. **README.md**
- No modifications to README.md (kept lightweight, following Kafka connector style ✓)
4. **Configuration Options Table**
- Removed duplicate "Common Configuration Options" table
- Quick Start examples now reference detailed sections below for full options
### 📝 Current Structure:
The Quick Start section in `docs/content/docs/connectors/table/http.md` (and Chinese version) now includes:
- SQL Example for HTTP Sink (using `http-async-sink`)
- SQL Example for HTTP Lookup Source (using `http`)
- DataStream API Example for HTTP Sink
- All examples point to detailed configuration sections in the docs
### ✅ Verification:
- Confirmed connector identifiers match the factory classes in code
- DataStream API example uses correct HttpSink.builder() API
- Markdown format validated
- CI passing on Java 11 & 17
Could you please take another look when you have a chance? All your feedback has been incorporated. Thank you! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39361][connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl merged PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39361][connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#issuecomment-4257487167
Hi @davidradl and @mariyageorge01,
You have both previously contributed to the HTTP connector documentation ([`docs/content/docs/connectors/table/http.md`](https://github.com/apache/flink-connector-http/blob/main/docs/content/docs/connectors/table/http.md)).
This PR adds a **Quick Start** section to help new users get started quickly with SQL and DataStream API examples. I have addressed all previous review comments, and the latest commits (pushed on 2026-03-31) have:
- Reorganized content to follow the style used by other Flink connectors (similar to the Kafka connector docs)
- Fixed all connector identifiers (`http-async-sink` → `http-sink` etc.)
- Added SQL examples for HTTP Sink and Lookup Source
- Added DataStream API (Java) example for `HttpSink`
- Added a configuration options reference table
CI is currently **passing** ✅ on both Java 11 and Java 17.
Could you please take a look and share your feedback? PTAL, thanks! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#issuecomment-4052474788
> I have looked at the Kafka connector and - we follow the style of its readme. The Getindata readme was effectively all of the docs. Now the docs are in a folder that will be picked up and knitted into the flink docs when we release. If you can find a nice place in the docs for this - then please change to add there.
Thank you for the guidance! That makes total sense — the README should stay lightweight (following the Kafka connector style), and the richer usage content belongs in docs/ where it gets knitted into the official Flink documentation on release.
I've taken a look at the existing docs/content/docs/connectors/datastream/http.md , which already contains the DataStream API usage. I'll move the Quick Start examples (including the SQL/Table API usage) into an appropriate section in the docs rather than keeping them in the README.
I'll update the README to just include a pointer to the docs, and add the Quick Start content into docs/content/docs/connectors/ — likely under a new section or alongside the existing http.md . Will push an update shortly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#discussion_r2945998276
##########
docs/content/docs/connectors/table/http.md:
##########
@@ -73,6 +73,119 @@ The HTTP source connector supports [Lookup Joins](https://nightlies.apache.org/f
* [Logging the HTTP content](#logging-the-http-content)
* [Restrictions at this time](#restrictions-at-this-time)
<!-- TOC -->
+## Quick Start
+
+This guide provides quick examples to get started with the HTTP connector.
+
+### SQL Example — HTTP Sink
+
+Use the HTTP Sink connector to write Flink records to an external HTTP endpoint via SQL:
+
+```sql
+CREATE TABLE http_sink (
+ id BIGINT,
+ name STRING,
+ status STRING
+) WITH (
+ 'connector' = 'http-sink',
+ 'url' = 'https://api.example.com/events',
+ 'format' = 'json',
+ 'insert-method' = 'POST'
+);
+
+INSERT INTO http_sink SELECT id, name, status FROM source_table;
+```
+
+Note: Flink SQL uses single quotes for string literals in WITH clause options.
+
+### SQL Example — HTTP Lookup Source
+
+Use the HTTP Lookup connector to enrich a stream with data from an external HTTP API:
+
+```sql
+-- Define the HTTP lookup table
+CREATE TABLE http_lookup (
+ id STRING,
+ payload STRING
+) WITH (
+ 'connector' = 'rest-lookup',
+ 'url' = 'https://api.example.com/data',
+ 'format' = 'json',
+ 'lookup-method' = 'GET'
+);
+
+-- Enrich a stream using a lookup join
+SELECT s.event_id, h.payload
+FROM stream_table AS s
+JOIN http_lookup FOR SYSTEM_TIME AS OF s.proc_time AS h
+ ON s.event_id = h.id;
+```
+
+### DataStream API Example — HTTP Sink
+
+Use the HTTP Sink connector in the Flink DataStream API:
+
+```java
+import org.apache.flink.connector.http.HttpSink;
+import org.apache.flink.connector.http.sink.HttpSinkRequestEntry;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.streaming.api.datastream.DataStream;
+
+import java.nio.charset.StandardCharsets;
+
+public class HttpSinkExample {
+ public static void main(String[] args) throws Exception {
+ StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+
+ // Create a simple source stream
+ DataStream<String> sourceStream = env.fromElements("event1", "event2", "event3");
+
+ // Configure the HTTP sink
+ HttpSink<String> httpSink = HttpSink.<String>builder()
+ .setEndpointUrl("https://api.example.com/events")
+ .setElementConverter(
+ (element, context) ->
+ new HttpSinkRequestEntry("POST", element.getBytes(StandardCharsets.UTF_8)))
+ .build();
+
+ // Send the source stream to the HTTP sink
+ sourceStream.sinkTo(httpSink);
+
+ // Execute the Flink job
+ env.execute("HTTP Sink Example");
+ }
+}
+```
+
+### Common Configuration Options
+
+| Option | Required | Default | Description |
+|---------------------------------------------|----------|---------|------------------------------------------------------------------------|
+| `connector` | required | — | Use `http-sink` for sink or `rest-lookup` for lookup source. |
Review Comment:
not correct for the apache connector.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39361][connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#issuecomment-4293169404
Hi @davidradl,
Thank you for your thorough review! 🙏
I've verified that all your review comments from March 17 have been addressed in the subsequent commits (March 31):
### ✅ All Issues Fixed:
1. **"the connector is 'http' not 'rest-lookup'"** → ✅ Fixed: now using `'connector' = 'http'` for lookup source
2. **"this is not required" (README.md)** → ✅ Fixed: Quick Start content moved from README to docs folder
3. **"This connector name is not correct"** → ✅ Fixed: changed to `'connector' = 'http-async-sink'` matching `HttpDynamicTableSinkFactory.IDENTIFIER`
4. **"not correct for the apache connector"** → ✅ Fixed: connector identifiers corrected
5. **"We already document these config options"** → ✅ Fixed: removed duplicate configuration table from Quick Start
### 📋 Current State:
- All review threads are marked as **resolved** ✅
- README.md remains lightweight (following Kafka connector style)
- Quick Start examples added to `docs/content/docs/connectors/table/http.md` (both EN and ZH versions)
- All connector identifiers verified against factory classes in code
- CI passing on Java 11 & 17
Could you please re-review when you have a moment? All your feedback has been incorporated. Thank you! 🙏
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#discussion_r2945804073
##########
docs/content/docs/connectors/table/http.md:
##########
@@ -73,6 +73,119 @@ The HTTP source connector supports [Lookup Joins](https://nightlies.apache.org/f
* [Logging the HTTP content](#logging-the-http-content)
* [Restrictions at this time](#restrictions-at-this-time)
<!-- TOC -->
+## Quick Start
+
+This guide provides quick examples to get started with the HTTP connector.
+
+### SQL Example — HTTP Sink
+
+Use the HTTP Sink connector to write Flink records to an external HTTP endpoint via SQL:
+
+```sql
+CREATE TABLE http_sink (
+ id BIGINT,
+ name STRING,
+ status STRING
+) WITH (
+ 'connector' = 'http-sink',
+ 'url' = 'https://api.example.com/events',
+ 'format' = 'json',
+ 'insert-method' = 'POST'
+);
+
+INSERT INTO http_sink SELECT id, name, status FROM source_table;
+```
+
+Note: Flink SQL uses single quotes for string literals in WITH clause options.
+
+### SQL Example — HTTP Lookup Source
+
+Use the HTTP Lookup connector to enrich a stream with data from an external HTTP API:
+
+```sql
+-- Define the HTTP lookup table
+CREATE TABLE http_lookup (
+ id STRING,
+ payload STRING
+) WITH (
+ 'connector' = 'rest-lookup',
Review Comment:
the connector is 'http' not 'rest-lookup'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39361][connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#issuecomment-4367924489
Hi @davidradl, friendly ping — this PR has been reshaped to follow your original feedback ("don't duplicate the readme — put things into `docs/`, in the style we use for Kafka"). All five review threads are now marked resolved / outdated, and the current HEAD (`ee45277`) only touches the documentation folder:
```
docs/content.zh/docs/connectors/table/http.md | 88 +++++++++++++++-------
docs/content/docs/connectors/table/http.md | 89 +++++++++++++++++-----
2 files changed, 169 insertions(+), 8 deletions(-)
```
Summary of changes since your review:
| Previous concern | Current state |
|------------------|---------------|
| *"put examples into `docs/`, not the README"* | No README change at all; Quick Start lives under `docs/content*/docs/connectors/table/http.md`. |
| *"connector name is not correct"* | Sink DDLs use `'connector' = 'http-async-sink'` (matches `HttpDynamicTableSinkFactory.IDENTIFIER`); lookup DDLs use `'connector' = 'http'` (matches `HttpLookupTableSourceFactory`). |
| *"don't document options twice — they could drift"* | Quick Start intentionally shows only the minimal required options (`url`, `format`, `insert-method`); the existing full option tables remain the single source of truth. Quick Start ends with a pointer to those sections. |
| *"please check the examples work"* | Verified locally: SQL options (`format`, `url`, `insert-method`) match `HttpDynamicTableSinkFactory.requiredOptions()` / `HttpLookupTableSourceFactory.requiredOptions()`; the DataStream example compiles against the current `HttpSink.builder()` / `HttpSinkRequestEntry(String, byte[])` API. |
| *"include a unit test to drive the sample"* | Happy to add a tiny compile-only smoke test if you still want one — let me know and I'll push it. |
GitHub Actions (Java 11 + 17) is green, PR is `MERGEABLE`. Could you take another look when you have a moment?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#discussion_r2945990012
##########
docs/content/docs/connectors/table/http.md:
##########
@@ -73,6 +73,119 @@ The HTTP source connector supports [Lookup Joins](https://nightlies.apache.org/f
* [Logging the HTTP content](#logging-the-http-content)
* [Restrictions at this time](#restrictions-at-this-time)
<!-- TOC -->
+## Quick Start
+
+This guide provides quick examples to get started with the HTTP connector.
+
+### SQL Example — HTTP Sink
+
+Use the HTTP Sink connector to write Flink records to an external HTTP endpoint via SQL:
+
+```sql
+CREATE TABLE http_sink (
+ id BIGINT,
+ name STRING,
+ status STRING
+) WITH (
+ 'connector' = 'http-sink',
Review Comment:
This connector name is not correct. Please can you try the examples and check they work. Maybe include a unit test to drive the sample.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [connector-http] Improve README with SQL examples [flink-connector-http]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #30:
URL: https://github.com/apache/flink-connector-http/pull/30#discussion_r2945985827
##########
README.md:
##########
@@ -66,3 +66,4 @@ This article describes [how to contribute to Apache Flink](https://flink.apache.
Apache Flink is an open source project of The Apache Software Foundation (ASF).
The Apache Flink project originated from the [Stratosphere](http://stratosphere.eu) research project.
+
Review Comment:
this is not required.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org