package cc.mrbird.febs.rabbit.consumer; import cc.mrbird.febs.dapp.service.DappSystemService; import cc.mrbird.febs.rabbit.QueueConstants; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; /** * @author wzy * @date 2022-05-31 **/ @Slf4j @Component @ConditionalOnProperty(prefix = "system", name = "online-transfer", havingValue = "true") public class ChainConsumer { @Autowired private DappSystemService dappSystemService; @RabbitListener(queues = QueueConstants.ONLINE_TRANSFER) public void onlineTransfer(String batchNo) { log.info("收到链上转账消息:{}", batchNo); dappSystemService.onlineTransfer(batchNo); } }