forked from apache/eventmesh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* runtime tcp http grpc client impl * check * check * check * check * check * check * check * check * Upgrade the grpc version. * check * check * ci try-catch * ci try-catch * redis client update * redis client update * redis client test * ci * ci * etcd add connect time * update * optimisation
- Loading branch information
Showing
31 changed files
with
1,365 additions
and
44 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
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
70 changes: 70 additions & 0 deletions
70
...ain/java/org/apache/eventmesh/dashboard/core/function/SDK/config/CreateRuntimeConfig.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,70 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF 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 org.apache.eventmesh.dashboard.core.function.SDK.config; | ||
|
||
import org.apache.eventmesh.common.protocol.tcp.UserAgent; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class CreateRuntimeConfig implements CreateSDKConfig { | ||
|
||
// 127.0.0.1:10105;127.0.0.2:10105 | ||
private String runtimeServerAddress; | ||
|
||
// protocol example:HTTP,TCP,GRPC | ||
private String protocol; | ||
// for tcp:cloudevents,eventmeshmessage,openmessage | ||
private String protocolName; | ||
|
||
// producer or consumer | ||
private String clientType; | ||
|
||
// topic | ||
private String topic; | ||
|
||
// config | ||
private String env; | ||
private String idc; | ||
private String ip; | ||
private String sys; | ||
private String pid; | ||
private String username; | ||
private String password; | ||
|
||
// producer | ||
private String producerGroup; | ||
|
||
// consumer | ||
private String consumerGroup; | ||
private String subUrl; | ||
|
||
// Agent | ||
private UserAgent userAgent; | ||
|
||
@Override | ||
public String getUniqueKey() { | ||
return runtimeServerAddress; | ||
} | ||
} |
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
54 changes: 54 additions & 0 deletions
54
...ache/eventmesh/dashboard/core/function/SDK/operation/RuntimeGrpcConsumerSDKOperation.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,54 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF 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 org.apache.eventmesh.dashboard.core.function.SDK.operation; | ||
|
||
import static org.apache.eventmesh.dashboard.core.function.SDK.util.RuntimeSDKOperationUtils.buildEventMeshGrpcConsumerConfig; | ||
|
||
import org.apache.eventmesh.client.grpc.config.EventMeshGrpcClientConfig; | ||
import org.apache.eventmesh.client.grpc.consumer.EventMeshGrpcConsumer; | ||
import org.apache.eventmesh.common.exception.EventMeshException; | ||
import org.apache.eventmesh.dashboard.core.function.SDK.AbstractSDKOperation; | ||
import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateRuntimeConfig; | ||
import org.apache.eventmesh.dashboard.core.function.SDK.config.CreateSDKConfig; | ||
|
||
import java.util.AbstractMap.SimpleEntry; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class RuntimeGrpcConsumerSDKOperation extends AbstractSDKOperation<EventMeshGrpcConsumer> { | ||
|
||
@Override | ||
public SimpleEntry<String, EventMeshGrpcConsumer> createClient(CreateSDKConfig clientConfig) { | ||
final CreateRuntimeConfig runtimeConfig = (CreateRuntimeConfig) clientConfig; | ||
final EventMeshGrpcClientConfig grpcClientConfig = buildEventMeshGrpcConsumerConfig(runtimeConfig); | ||
EventMeshGrpcConsumer grpcConsumer = null; | ||
try { | ||
grpcConsumer = new EventMeshGrpcConsumer(grpcClientConfig); | ||
grpcConsumer.init(); | ||
} catch (EventMeshException e) { | ||
log.error("create runtime grpc Consumer client failed", e); | ||
} | ||
return new SimpleEntry<>(clientConfig.getUniqueKey(), grpcConsumer); | ||
} | ||
|
||
@Override | ||
public void close(Object client) { | ||
castClient(client).close(); | ||
} | ||
} |
Oops, something went wrong.