[richfaces-issues] [JBoss JIRA] (RF-12219) Push: Test that messages do not become stale in a queue

Milo van der Zee (JIRA) jira-events at lists.jboss.org
Mon May 14 07:31:20 EDT 2012


    [ https://issues.jboss.org/browse/RF-12219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12692599#comment-12692599 ] 

Milo van der Zee edited comment on RF-12219 at 5/14/12 7:30 AM:
----------------------------------------------------------------

{{monospaced}}
/**
 * Send push events to configured topics.
 */
public class PushTriggerJob implements BatchJobInterface {
	private static final Logger LOGGER = Logger.getLogger(PushTriggerJob.class);

	@Override
	public void executeBatch(BatchJobContext context) {
		String[] pushKeys = context.getParameters().trim().split(",");
		TopicsContext topicsContext = TopicsContext.lookup();

		boolean first = true;
		for (String pushKey : pushKeys) {
			if (!first) {
				// delay 1 second for all except the first one
				Utils.sleep(1000);
			}
			first = false;
			try {
				LOGGER.debug("triggerPush: pushing '" + pushKey + "' topicsContext: " + topicsContext);
				topicsContext.publish(new TopicKey(pushKey), null);
			} catch (MessageException e) {
				LOGGER.error("executeBatch, topicsContext: " + topicsContext, e);
			}
		}
	}
}
{{monospaced}}

                
      was (Author: MilovdZee):
    /**
 * Send push events to configured topics.
 */
public class PushTriggerJob implements BatchJobInterface {
	private static final Logger LOGGER = Logger.getLogger(PushTriggerJob.class);

	@Override
	public void executeBatch(BatchJobContext context) {
		String[] pushKeys = context.getParameters().trim().split(",");
		TopicsContext topicsContext = TopicsContext.lookup();

		boolean first = true;
		for (String pushKey : pushKeys) {
			if (!first) {
				// delay 1 second for all except the first one
				Utils.sleep(1000);
			}
			first = false;
			try {
				LOGGER.debug("triggerPush: pushing '" + pushKey + "' topicsContext: " + topicsContext);
				topicsContext.publish(new TopicKey(pushKey), null);
			} catch (MessageException e) {
				LOGGER.error("executeBatch, topicsContext: " + topicsContext, e);
			}
		}
	}
}

                  
> Push: Test that messages do not become stale in a queue
> -------------------------------------------------------
>
>                 Key: RF-12219
>                 URL: https://issues.jboss.org/browse/RF-12219
>             Project: RichFaces
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>          Components: component-push/poll
>    Affects Versions: 4.2.1.Final
>            Reporter: Lukáš Fryč
>
> According to the [Forum reference],
> we can have problems with stale messages.
> I would suggest to write tests for following scenarios and check that queue is destroyed properly:
> * view expires
> * client leaves the page with {{a4j:push}} without proper clean up
> * ...
> Let's brainstorm other scenarios.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the richfaces-issues mailing list