Skip to content

Commit

Permalink
runtime update (#612)
Browse files Browse the repository at this point in the history
* update java sdk

* fix compile error

* fix sdk error

* 1.remove the openmessage from connector-api
2.fix the standalone connector
  • Loading branch information
xwm1992 authored Nov 25, 2021
1 parent 1c34373 commit d8eb87f
Show file tree
Hide file tree
Showing 37 changed files with 527 additions and 1,156 deletions.
2 changes: 1 addition & 1 deletion docs/cn/features/spi.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class RocketMQProducerImpl implements MeshMQProducer {
```

同时,还需要在eventmesh-connector-rocketmq模块中resource/META-INF/eventmesh目录下创建文件名为SPI接口全限定名的文件
org.apache.eventmesh.api.producer.MeshMQProducer
org.apache.eventmesh.api.producer.Producer

文件内容为扩展实例名和对应的实例全类名

Expand Down
2 changes: 1 addition & 1 deletion docs/en/features/spi.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class RocketMQProducerImpl implements MeshMQProducer {
At the same time, we need to create a file with the full qualified name of the SPI interface under the resource/META-INF/eventmesh directory
in the eventmesh-connector-rocketmq module.

org.apache.eventmesh.api.producer.MeshMQProducer
org.apache.eventmesh.api.producer.Producer

The content of the file is the extension instance name and the corresponding instance full class name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation project(":eventmesh-spi")
implementation project(":eventmesh-common")
api 'io.cloudevents:cloudevents-core'
api 'io.openmessaging:openmessaging-api'
// api 'io.openmessaging:openmessaging-api'
api 'io.dropwizard.metrics:metrics-core'
api "io.dropwizard.metrics:metrics-healthchecks"
api "io.dropwizard.metrics:metrics-annotation"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
* 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.api;

import io.openmessaging.api.Message;

public interface RRCallback {

public void onSuccess(Message msg);

public void onException(Throwable e);

}
///*
// * 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.api;
//
//import io.openmessaging.api.Message;
//
//public interface RRCallback {
//
// public void onSuccess(Message msg);
//
// public void onException(Throwable e);
//
//}
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
/*
* 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.api.consumer;

import java.util.List;
import java.util.Properties;

import io.openmessaging.api.AsyncMessageListener;
import io.openmessaging.api.Consumer;
import io.openmessaging.api.Message;

import org.apache.eventmesh.api.AbstractContext;
import org.apache.eventmesh.spi.EventMeshExtensionType;
import org.apache.eventmesh.spi.EventMeshSPI;

@EventMeshSPI(isSingleton = false, eventMeshExtensionType = EventMeshExtensionType.CONNECTOR)
public interface MeshMQPushConsumer extends Consumer {

void init(Properties keyValue) throws Exception;

void updateOffset(List<Message> msgs, AbstractContext context);

// void registerMessageListener(MessageListenerConcurrently messageListenerConcurrently);

void subscribe(String topic, final AsyncMessageListener listener) throws Exception;

@Override
void unsubscribe(String topic);
}
///*
// * 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.api.consumer;
//
//import java.util.List;
//import java.util.Properties;
//
//import org.apache.eventmesh.api.AbstractContext;
//import org.apache.eventmesh.spi.EventMeshExtensionType;
//import org.apache.eventmesh.spi.EventMeshSPI;
//
//@EventMeshSPI(isSingleton = false, eventMeshExtensionType = EventMeshExtensionType.CONNECTOR)
//public interface MeshMQPushConsumer extends Consumer {
//
// void init(Properties keyValue) throws Exception;
//
// void updateOffset(List<Message> msgs, AbstractContext context);
//
//// void registerMessageListener(MessageListenerConcurrently messageListenerConcurrently);
//
// void subscribe(String topic, final AsyncMessageListener listener) throws Exception;
//
// @Override
// void unsubscribe(String topic);
//}
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
/*
* 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.api.producer;

import java.util.Properties;

import io.openmessaging.api.Message;
import io.openmessaging.api.Producer;
import io.openmessaging.api.SendCallback;

import org.apache.eventmesh.api.RRCallback;
import org.apache.eventmesh.spi.EventMeshExtensionType;
import org.apache.eventmesh.spi.EventMeshSPI;

@EventMeshSPI(isSingleton = false, eventMeshExtensionType = EventMeshExtensionType.CONNECTOR)
public interface MeshMQProducer extends Producer {

void init(Properties properties) throws Exception;

void send(Message message, SendCallback sendCallback) throws Exception;

void request(Message message, RRCallback rrCallback, long timeout) throws Exception;

boolean reply(final Message message, final SendCallback sendCallback) throws Exception;

void checkTopicExist(String topic) throws Exception;

void setExtFields();

}
///*
// * 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.api.producer;
//
//import java.util.Properties;
//
//import io.openmessaging.api.Message;
//import io.openmessaging.api.Producer;
//import io.openmessaging.api.SendCallback;
//
//import org.apache.eventmesh.api.RRCallback;
//import org.apache.eventmesh.spi.EventMeshExtensionType;
//import org.apache.eventmesh.spi.EventMeshSPI;
//
//@EventMeshSPI(isSingleton = false, eventMeshExtensionType = EventMeshExtensionType.CONNECTOR)
//public interface MeshMQProducer extends Producer {
//
// void init(Properties properties) throws Exception;
//
// void send(Message message, SendCallback sendCallback) throws Exception;
//
// void request(Message message, RRCallback rrCallback, long timeout) throws Exception;
//
// boolean reply(final Message message, final SendCallback sendCallback) throws Exception;
//
// void checkTopicExist(String topic) throws Exception;
//
// void setExtFields();
//
//}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.eventmesh.api.producer;

import org.apache.eventmesh.api.LifeCycle;
import org.apache.eventmesh.api.RRCallback;
import org.apache.eventmesh.api.RequestReplyCallback;
import org.apache.eventmesh.api.SendCallback;
import org.apache.eventmesh.api.SendResult;
Expand All @@ -45,7 +44,7 @@ public interface Producer extends LifeCycle {

void sendAsync(final CloudEvent cloudEvent, final SendCallback sendCallback);

void request(CloudEvent cloudEvent, RRCallback rrCallback, long timeout) throws Exception;
// void request(CloudEvent cloudEvent, RRCallback rrCallback, long timeout) throws Exception;

void request(CloudEvent cloudEvent, RequestReplyCallback rrCallback, long timeout) throws Exception;

Expand Down
Loading

0 comments on commit d8eb87f

Please sign in to comment.