Add spring cloud stream rocketmq thread pool to adapt to open source protocol

pull/235/head
chen.ma 3 years ago
parent 86376b1942
commit 0313786a47

@ -1,3 +1,20 @@
/*
* 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 cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example; package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example;
import cn.hippo4j.core.enable.EnableDynamicThreadPool; import cn.hippo4j.core.enable.EnableDynamicThreadPool;

@ -1,3 +1,20 @@
/*
* 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 cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example; package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example;
import cn.hippo4j.example.core.dto.SendMessageDTO; import cn.hippo4j.example.core.dto.SendMessageDTO;
@ -23,7 +40,8 @@ public class MessageConsume {
try { try {
// ignore // ignore
} finally { } finally {
log.info("Keys: {}, Msg id: {}, Execute time: {} ms, Message: {}", headers.get("rocketmq_KEYS"), headers.get("rocketmq_MESSAGE_ID"), System.currentTimeMillis() - startTime, JSON.toJSONString(message)); log.info("Keys: {}, Msg id: {}, Execute time: {} ms, Message: {}", headers.get("rocketmq_KEYS"), headers.get("rocketmq_MESSAGE_ID"), System.currentTimeMillis() - startTime,
JSON.toJSONString(message));
} }
log.info("Input current thread name: {}", Thread.currentThread().getName()); log.info("Input current thread name: {}", Thread.currentThread().getName());
} }
@ -34,7 +52,8 @@ public class MessageConsume {
try { try {
// ignore // ignore
} finally { } finally {
log.info("Keys: {}, Msg id: {}, Execute time: {} ms, Message: {}", headers.get("rocketmq_KEYS"), headers.get("rocketmq_MESSAGE_ID"), System.currentTimeMillis() - startTime, JSON.toJSONString(message)); log.info("Keys: {}, Msg id: {}, Execute time: {} ms, Message: {}", headers.get("rocketmq_KEYS"), headers.get("rocketmq_MESSAGE_ID"), System.currentTimeMillis() - startTime,
JSON.toJSONString(message));
} }
log.info("Input2 current thread name: {}", Thread.currentThread().getName()); log.info("Input2 current thread name: {}", Thread.currentThread().getName());
} }

@ -1,3 +1,20 @@
/*
* 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 cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example; package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example;
import cn.hippo4j.example.core.dto.SendMessageDTO; import cn.hippo4j.example.core.dto.SendMessageDTO;

@ -1,3 +1,20 @@
/*
* 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 cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example; package cn.hippo4j.springboot.starter.adapter.springcloud.stream.rocketmq.example;
import org.springframework.cloud.stream.annotation.Input; import org.springframework.cloud.stream.annotation.Input;

Loading…
Cancel
Save