Skip to content

Conversation

@hengboy
Copy link
Member

@hengboy hengboy commented Sep 7, 2020

No description provided.

@hengboy hengboy added the kind/feature New features label Sep 7, 2020
@hengboy hengboy self-assigned this Sep 7, 2020
@hengboy hengboy linked an issue Sep 7, 2020 that may be closed by this pull request
@hengboy hengboy merged commit ede9938 into minbox-projects:2.3.x Sep 7, 2020
@hengboy
Copy link
Member Author

hengboy commented Sep 7, 2020

使用方式参考:

/**
 * 自定义配置{@link org.minbox.framework.message.pipe.core.transport.RequestIdGenerator}
 *
 * @author 恒宇少年
 */
@Component
public class RequestIdCustomizer implements MessagePipeConfigurationCustomizer {
    @Override
    public void customize(MessagePipeConfiguration configuration) {
        RequestIdGenerator generator = new UuidRequestIdGenerator();
        configuration.setRequestIdGenerator(generator);
    }

    /**
     * 使用Uuid随机数生成请求ID
     */
    class UuidRequestIdGenerator implements RequestIdGenerator {
        @Override
        public String generate() {
            return UUID.randomUUID().toString();
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

新增MessagePipeConfiguration配置类的自定义Customizer接口

1 participant