Skip to content

Commit

Permalink
fix exception & config
Browse files Browse the repository at this point in the history
  • Loading branch information
Fungx committed Dec 11, 2023
1 parent 115e599 commit cf49f64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ public Class<? extends Config> configClass() {
}

@Override
public void init(Config config) throws Exception {
public void init(Config config) {
this.sourceConfig = (HttpSourceConfig) config;
doInit();
}

@Override
public void init(ConnectorContext connectorContext) throws Exception {
public void init(ConnectorContext connectorContext) {
SourceConnectorContext sourceConnectorContext = (SourceConnectorContext) connectorContext;
this.sourceConfig = (HttpSourceConfig) sourceConnectorContext.getSourceConfig();
doInit();
}

private void doInit() throws Exception {
private void doInit() {
this.queue = new LinkedBlockingQueue<>(1000);

final Vertx vertx = Vertx.vertx();
Expand Down Expand Up @@ -100,11 +100,11 @@ private void doInit() throws Exception {
}

@Override
public void start() throws Exception {
public void start() {
Throwable t = this.server.listen().cause();
if (t != null) {
log.error("[HttpSourceConnector] Failed to start Vertx server.", t);
throw new EventMeshException("Failed to start Vertx server");
log.error("[HttpSourceConnector] Failed to start Vertx server.");
throw new EventMeshException(t);
}
}

Expand All @@ -119,11 +119,11 @@ public String name() {
}

@Override
public void stop() throws Exception {
public void stop() {
Throwable t = this.server.close().cause();
if (t != null) {
log.error("[HttpSourceConnector] Failed to stop Vertx server.", t);
throw new EventMeshException("Failed to stop Vertx server");
log.error("[HttpSourceConnector] Failed to stop Vertx server.");
throw new EventMeshException(t);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pubSubConfig:
group: httpSource
appId: 5032
userName: httpSourceUser
passWord: httpmqPassWord
passWord: httpPassWord
connectorConfig:
connectorName: httpSource
path: /test
Expand Down

0 comments on commit cf49f64

Please sign in to comment.