Hystrix command on request collapser fallback

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Hystrix command on request collapser fallback



I have a scenario where I want to apply hystrix on the fallback (and process one-by-one) of a hystrix request collapser's batch method.

The fallback method (processEntryBatch_fallback) is invoked. But the hystrix command (processEntryBackup) in turn the fallback invokes is not reported (doesn't even appear on dashboard). And the fallback method (finalFallback) is not invoked either.

I would like to know what am I missing here ?

I referred javanica documentation


processEntryBatch_fallback


processEntryBackup


finalFallback


@Service
public class DummyService

private static final Logger log = LoggerFactory.getLogger(DummyService.class);

//batch processing method
public void processEntry(List<String> msg)
//batch processing
throw new RuntimeException("Exception while batch processing");


//processing one-by-one
@HystrixCommand(fallbackMethod="finalFallback")
public void processEntryBackup(String msg)
throw new RuntimeException("Exception while single processing");


public void finalFallback(String msg)
log.info("logging..." + msg);


@HystrixCollapser(batchMethod = "processEntryBatch", collapserKey="ProcessEntryCollapser", scope=Scope.GLOBAL)
public Future<Object> processEntryCollapser(String msg)
return null;


@HystrixCommand(fallbackMethod="processEntryBatch_fallback")
public List<Object> processEntryBatch(List<String> msgList)
processEntry(msgList);
return new ArrayList<>(msgList);


public List<Object> processEntryBatch_fallback(List<String> msgList)
for (String msg : msgList)
processEntryBackup(msg);

return new ArrayList<>(msgList);










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

Trying to Print Gridster Items to PDF without overlapping contents