Skip to content

Commit

Permalink
Merge pull request #401 from wcnnkh/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wcnnkh authored Mar 23, 2023
2 parents d0e96bf + 10da734 commit c2791f9
Show file tree
Hide file tree
Showing 186 changed files with 2,359 additions and 2,420 deletions.
2 changes: 1 addition & 1 deletion activemq-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>activemq-broker</artifactId>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion activemq-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>activemq-client</artifactId>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>amqp</artifactId>
<dependencies>
Expand Down
13 changes: 5 additions & 8 deletions amqp/src/main/java/io/basc/framework/amqp/AbstractExchange.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import io.basc.framework.json.JsonUtils;
import io.basc.framework.lang.NestedExceptionUtils;
import io.basc.framework.logger.Logger;
import io.basc.framework.logger.LoggerFactory;
Expand Down Expand Up @@ -135,7 +134,7 @@ public void onMessage(String exchange, String routingKey, Message<T> message) th
// 这是一个延迟消息
if (logger.isDebugEnabled()) {
logger.debug("delay message forward exchange:{}, routingKey:{}, message:{}", exchange, routingKey,
JsonUtils.getSupport().toJsonString(message));
message);
}

message.setDelay(0, TimeUnit.SECONDS);
Expand All @@ -148,16 +147,15 @@ public void onMessage(String exchange, String routingKey, Message<T> message) th
int delay = 1;
TimeUnit delayTimeUnit = TimeUnit.SECONDS;
logger.error("retry delay: {}, Unable to consume exchange:{}, routingKey:{}, message:{}",
delayTimeUnit.toMillis(delay), exchange, routingKeyToUse,
JsonUtils.getSupport().toJsonString(message));
delayTimeUnit.toMillis(delay), exchange, routingKeyToUse, message);
message.setDelay(delay, delayTimeUnit);
retryPush(routingKeyToUse, message);
return;
}

if (logger.isDebugEnabled()) {
logger.debug("handleDelivery exchange:{}, routingKey:{}, message:{}", exchange, routingKeyToUse,
JsonUtils.getSupport().toJsonString(message));
message);
}

// 开始消费消息
Expand Down Expand Up @@ -190,11 +188,10 @@ public void onMessage(String exchange, String routingKey, Message<T> message) th
|| (maxRetryCount > 0 && message.getRetryCount() > maxRetryCount)) {// 不重试
logger.error(NestedExceptionUtils.getRootCause(e),
"Don't try again: exchange={}, routingKey={}, message={}", exchange, routingKeyToUse,
JsonUtils.getSupport().toJsonString(message));
message);
} else {
logger.error(NestedExceptionUtils.getRootCause(e),
"retry delay: {}, exchange={}, routingKey={}, message={}", retryDelay, exchange,
routingKeyToUse, JsonUtils.getSupport().toJsonString(message));
"retry delay: {}, exchange={}, routingKey={}, message={}", retryDelay, exchange, message);
message.setDelay(retryDelay, TimeUnit.MILLISECONDS);
retryPush(routingKeyToUse, message);
}
Expand Down
6 changes: 6 additions & 0 deletions amqp/src/main/java/io/basc/framework/amqp/Message.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package io.basc.framework.amqp;

import io.basc.framework.util.Assert;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class Message<T> extends MessageProperties {
private static final long serialVersionUID = 1L;
private final T body;
Expand Down
120 changes: 5 additions & 115 deletions amqp/src/main/java/io/basc/framework/amqp/MessageProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import io.basc.framework.script.MathScriptEngine;
import io.basc.framework.util.StringUtils;
import io.basc.framework.value.Value;
import lombok.Data;

@Data
public class MessageProperties implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
private static final String DELAY_MESSAGE = "framework.amqp.message.delay";
Expand All @@ -38,7 +40,7 @@ public class MessageProperties implements Serializable, Cloneable {
private String userId;
private String appId;
private String clusterId;

public MessageProperties() {
}

Expand Down Expand Up @@ -66,122 +68,10 @@ public MessageProperties clone() {
return new MessageProperties(this);
}

public String getContentType() {
return contentType;
}

public void setContentType(String contentType) {
this.contentType = contentType;
}

public String getContentEncoding() {
return contentEncoding;
}

public void setContentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
}

public Map<String, Object> getHeaders() {
return headers;
}

public void setHeaders(Map<String, Object> headers) {
this.headers = headers;
}

public Integer getDeliveryMode() {
return deliveryMode;
}

public void setDeliveryMode(Integer deliveryMode) {
this.deliveryMode = deliveryMode;
}

public Integer getPriority() {
return priority;
}

public void setPriority(Integer priority) {
this.priority = priority;
}

public String getCorrelationId() {
return correlationId;
}

public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}

public String getReplyTo() {
return replyTo;
}

public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}

public String getExpiration() {
return expiration;
}

public void setExpiration(Long expiration) {
public void setLongExpiration(Long expiration) {
this.expiration = expiration == null ? null : ("" + expiration);
}

public void setExpiration(String expiration) {
this.expiration = expiration;
}

public String getMessageId() {
return messageId;
}

public void setMessageId(String messageId) {
this.messageId = messageId;
}

public Date getTimestamp() {
return timestamp;
}

public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getUserId() {
return userId;
}

public void setUserId(String userId) {
this.userId = userId;
}

public String getAppId() {
return appId;
}

public void setAppId(String appId) {
this.appId = appId;
}

public String getClusterId() {
return clusterId;
}

public void setClusterId(String clusterId) {
this.clusterId = clusterId;
}

public Object getHeader(String name) {
if (headers == null) {
return null;
Expand Down Expand Up @@ -226,7 +116,7 @@ public MessageProperties setDelay(long delay, TimeUnit timeUnit) {
removeHeader(DELAY_MESSAGE);
setExpiration((String) null);
} else {
setExpiration(timeUnit.toMillis(delay));
setLongExpiration(timeUnit.toMillis(delay));
setHeader(DELAY_MESSAGE, getExpiration());
}
return this;
Expand Down
2 changes: 1 addition & 1 deletion apollo-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>apollo-client</artifactId>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import io.basc.framework.context.annotation.Provider;
import io.basc.framework.event.ChangeEvent;
import io.basc.framework.event.EventTypes;
import io.basc.framework.event.ChangeType;
import io.basc.framework.event.support.StandardBroadcastEventDispatcher;
import io.basc.framework.value.PropertyFactory;
import io.basc.framework.value.Value;
Expand Down Expand Up @@ -37,6 +37,6 @@ public Value get(String key) {

@Override
public void onChange(ConfigChangeEvent changeEvent) {
publishEvent(new ChangeEvent<Collection<String>>(EventTypes.UPDATE, changeEvent.changedKeys()));
publishEvent(new ChangeEvent<Collection<String>>(ChangeType.UPDATE, changeEvent.changedKeys()));
}
}
2 changes: 1 addition & 1 deletion boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>boot</artifactId>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void startServer() {

@Override
public void destroy() {
getLogger().info(new SplitLine("Start destroying application[{}]"), this);
getLogger().info(new SplitLine("Start destroying application[{}]").toString(), this);
super.destroy();
}

Expand Down
2 changes: 1 addition & 1 deletion cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>cloud</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion consistency/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>consistency</artifactId>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>console</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>context</artifactId>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import io.basc.framework.logger.Logger;
import io.basc.framework.logger.LoggerFactory;
import io.basc.framework.mapper.Field;
import io.basc.framework.mapper.MapperUtils;

public abstract class IocProcessor implements BeanPostProcessor {
protected static Logger logger = LoggerFactory.getLogger(IocProcessor.class);
Expand Down Expand Up @@ -41,10 +40,5 @@ public void checkField(Object obj, Field field) {
logger.warn("class [{}] field [{}] is a static", field.getSetter().getDeclaringClass(),
field.getSetter().getName());
}

if (MapperUtils.isExistValue(field, obj)) {
logger.warn("class[{}] fieldName[{}] existence default value", field.getSetter().getDeclaringClass(),
field.getSetter().getName());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ public XmlBeanDefinition(Context context, Class<?> targetClass, Node beanNode) t
setSingleton(XmlBeanUtils.isSingleton(beanNode));
}

@SuppressWarnings("unchecked")
protected Collection<String> getFilters(Node node) {
String filters = DomUtils.getNodeAttributeValue(node, "filters").getAsString();
if (StringUtils.isEmpty(filters)) {
return Collections.EMPTY_LIST;
return Collections.emptyList();
}

return Arrays.asList(StringUtils.splitToArray(filters));
Expand All @@ -84,7 +83,7 @@ public boolean isInstance() {
return super.isInstance();
}

for (ParameterDescriptors parameterDescriptors : this) {
for (ParameterDescriptors parameterDescriptors : this) {
if (xmlParameterFactory.isAccept(parameterDescriptors)) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.basc.framework</groupId>
<artifactId>framework</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>core</artifactId>
<dependencies>
Expand Down
Loading

0 comments on commit c2791f9

Please sign in to comment.