猿问

Finchley.SR4使用spring cloud stream, 开启多个实例,不分组,为什么只有一个实例收到消息?

如题,下面贴代码了:

public interface StreamClient {

    String queueNameIn = "OneMessageIn";
    String queueNameOut = "OneMessageOut";

    @Input(queueNameIn)
    SubscribableChannel input();

    @Output(queueNameOut)
    MessageChannel output();

}
@Component
@EnableBinding({StreamClient.class})
@Slf4j
public class StreamReceiver {

    @StreamListener(StreamClient.queueNameIn)
    @SendTo(StreamClient.queueNameOut)
    public SysUser oneMessageIn(SysUser sysUser) {
        log.info("{}", sysUser);
        return sysUser;
    }

    @StreamListener(StreamClient.queueNameOut)
    public void oneMessageOut(SysUser sysUser) {
        log.info("{}", sysUser.getAvatar());
    }

}
@RestController
@RequestMapping("/stream")
public class StreamMqController {

    @Autowired
    private StreamClient streamClient;

    @GetMapping("")
    public void testQueue(){
        SysUser sysUser=new SysUser();
        sysUser.setAvatar("1.png");
        sysUser.setName("gaojingsi");
        streamClient.input().send(MessageBuilder.withPayload(sysUser).build());
    }

}

启动了两个实例,9090和9091端口,访问9090端口,就是9090收到,访问9091,就是9091收到,想两个实例都收到怎么办啊?

他门说这就是人生
浏览 589回答 0
0回答

他门说这就是人生

垃圾信息太多,谨以此关闭提问。

慕斯4360584

AVVRSXJGGDTJSPJCDXANVLKJIPGUKPVOBFIEUOKTYCTWNMPDWZCWCFPQTYSOYGMAUIFKNEUKNZJGTEWIVZDMICCCCLONHXXKYLIODNXKQOXZZCPYRBVRFBGJTYLUETEULLFIKAZJWTWWZYXFXLBVJFJTTJWICNURXRUULHPYPFMZVVZERQJTFQUBUWCUFPBDJWVYISKNPTXJSZAHTTIIBBBUJZTGPXAXGWFVEUQXTVRMEUXADGURMQGWYVEOEEAAXAILVEBYMPLVYTQTJMIOWSBFNVZJLVZNQOFOXADMPBXGKTWEUXACBPUVMXYAYWYKRLPRFZKAITVSCGCMYRIMGXWIMQFSKYFTECJNHPOYZDIMGEFTBPMXLFSBQEVPTHBXIEVRCKOFTNBIDUSPVJHLPZKORD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