package com.goafanti.message.queue;

import org.springframework.beans.factory.annotation.Autowired;

import com.goafanti.message.JGMessageHelper;
import com.goafanti.message.bo.MessageAdapter;


public class MessageRedisQueueListener implements RedisQueueListener<MessageAdapter>{
	@Autowired
	JGMessageHelper jgMessageHelper;

	@Override
	public void onMessage(MessageAdapter messageAdapter) {
		if (messageAdapter.getTryCount() < 3) {
			jgMessageHelper.send(messageAdapter);
		}
	}


}
