Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #5031] Http Connector Adaptation Work #5032

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.eventmesh.connector.http.config.HttpServerConfig;
import org.apache.eventmesh.connector.http.sink.HttpSinkConnector;
import org.apache.eventmesh.connector.http.source.connector.HttpSourceConnector;
import org.apache.eventmesh.connector.http.source.HttpSourceConnector;
import org.apache.eventmesh.openconnect.Application;
import org.apache.eventmesh.openconnect.util.ConfigUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.eventmesh.connector.http.sink.handle.HttpSinkHandler;
import org.apache.eventmesh.connector.http.sink.handle.RetryHttpSinkHandler;
import org.apache.eventmesh.connector.http.sink.handle.WebhookHttpSinkHandler;
import org.apache.eventmesh.openconnect.api.ConnectorCreateService;
import org.apache.eventmesh.openconnect.api.connector.ConnectorContext;
import org.apache.eventmesh.openconnect.api.connector.SinkConnectorContext;
import org.apache.eventmesh.openconnect.api.sink.Sink;
Expand All @@ -37,7 +38,7 @@
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HttpSinkConnector implements Sink {
public class HttpSinkConnector implements Sink, ConnectorCreateService<Sink> {

private HttpSinkConfig httpSinkConfig;

Expand All @@ -49,6 +50,11 @@ public Class<? extends Config> configClass() {
return HttpSinkConfig.class;
}

@Override
public Sink create() {
return new HttpSinkConnector();
}

@Override
public void init(Config config) throws Exception {
this.httpSinkConfig = (HttpSinkConfig) config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
* limitations under the License.
*/

package org.apache.eventmesh.connector.http.source.connector;
package org.apache.eventmesh.connector.http.source;

import org.apache.eventmesh.common.config.connector.Config;
import org.apache.eventmesh.common.config.connector.http.HttpSourceConfig;
import org.apache.eventmesh.common.exception.EventMeshException;
import org.apache.eventmesh.connector.http.common.SynchronizedCircularFifoQueue;
import org.apache.eventmesh.connector.http.source.protocol.Protocol;
import org.apache.eventmesh.connector.http.source.protocol.ProtocolFactory;
import org.apache.eventmesh.openconnect.api.ConnectorCreateService;
import org.apache.eventmesh.openconnect.api.connector.ConnectorContext;
import org.apache.eventmesh.openconnect.api.connector.SourceConnectorContext;
import org.apache.eventmesh.openconnect.api.source.Source;
Expand All @@ -43,7 +44,7 @@
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HttpSourceConnector implements Source {
public class HttpSourceConnector implements Source, ConnectorCreateService<Source> {

private HttpSourceConfig sourceConfig;

Expand Down Expand Up @@ -73,6 +74,11 @@ public Class<? extends Config> configClass() {
return HttpSourceConfig.class;
}

@Override
public Source create() {
return new HttpSourceConnector();
}

@Override
public void init(Config config) {
this.sourceConfig = (HttpSourceConfig) config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
* limitations under the License.
*/

package org.apache.eventmesh.connector.http.source.connector;
package org.apache.eventmesh.connector.http.sink;


import static org.mockserver.model.HttpRequest.request;

import org.apache.eventmesh.connector.http.sink.HttpSinkConnector;
import org.apache.eventmesh.connector.http.sink.config.HttpSinkConfig;
import org.apache.eventmesh.connector.http.sink.config.HttpWebhookConfig;
import org.apache.eventmesh.openconnect.offsetmgmt.api.data.ConnectRecord;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.connector.http.source.connector;
package org.apache.eventmesh.connector.http.source;


import org.apache.eventmesh.common.config.connector.http.HttpSourceConfig;
Expand Down
Loading