根据另一个函数的结果调用函数(Kafka)

时间:2019-02-26 04:26:25

标签: java spring-boot apache-kafka kafka-consumer-api spring-kafka

我有职能 A,B和C 当我调用函数A()时,它将发送一个kafka notif,并且一旦处理了notif并且将响应发送回去,我就需要调用函数B(),这又将发送一个kafka notif,依此类推,等等,然后处理后,我们需要调用C()。

除了在A()的句柄响应中调用B()之外,还有什么方法可以实现?

例如:

Sub Project Service has 
Class TestService
{
    function A()
     {
        Call Kafka Producer From SubProject KafkaProducer()
     }

function B()
     {
          Call Kafka Producer From SubProject KafkaProducer()
     }

}


Sub Project "KafkaService" has 
Class KafkaSvc
{
    @KafkaListener
    Process KafkaMessage()
    {
       Process Kafka Message and send back result to ReceivedResult.

    }
}


Sub Project "ReceivedResult" has

Class KafkaReceive
{

    @KafkaListener
    process KafkaMessageReceived()
    {
       Once it's processed here, B() has to be triggered
    }
}

0 个答案:

没有答案