Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: ERROR: Dispatcher has no subscribers

  1. #11
    Join Date
    Apr 2005
    Posts
    112

    Default

    Thanks Mark, let me remove the asynchronous behavior and try it. Actually I do not really need the asynchronous behavior. The invocation is all synchronous.

  2. #12
    Join Date
    Apr 2005
    Posts
    112

    Default

    Now my message is getting processed. The database response is sent to the aggregator. But the web service response is not. Do I need a completion strategy here? The two part response should be combined into a single response using transaction id (114880765489) as the correlation strategy.

    I see the following entry in the log after the first response received in the aggregator:
    2009-09-04 16:10:00,669 DEBUG [org.springframework.integration.aggregator.MethodI nvokingAggregator] - Handling of Message group with correlationKey '114880765489' has already completed or timed out.

    Any insight would be helpful

    SearchResponse.java
    Code:
    public class SearchResponse extends TransactionInfo implements Serializable {
    
    	private static final long serialVersionUID = 1L;
    	
    	private IvsResponse ivsResponse;
    	private StopResponse stopResponse;
    	
    	/**
    	 * @return the ivsResponse
    	 */
    	public IvsResponse getIvsResponse() {
    		return ivsResponse;
    	}
    	/**
    	 * @param ivsResponse the ivsResponse to set
    	 */
    	public void setIvsResponse(IvsResponse ivsResponse) {
    		this.ivsResponse = ivsResponse;
    	}
    	/**
    	 * @return the stopResponse
    	 */
    	public StopResponse getStopResponse() {
    		return stopResponse;
    	}
    	/**
    	 * @param stopResponse the stopResponse to set
    	 */
    	public void setStopResponse(StopResponse stopResponse) {
    		this.stopResponse = stopResponse;
    	}
    Service Activator API implementation logic:

    Code:
    @ServiceActivator(inputChannel="stopRequest", outputChannel="responseAggregator")
    	public SearchResponse getStopResponse(SearchRequest searchRequest)
    			throws InvalidDataException, 
    						DataAccessFailedException,
    							  InvalidRegionException, 
    							  		DatatypeConfigurationException {
    		
    		SearchResponse searchResponse = null;
    				
    		try{			
    			
    			StopResponse stopResponse;
    			List<Messages> messageList;
    			
    			StopRequest stopRequest = new StopRequest();
    			stopRequest.setBusiness(searchRequest.getBusiness());
    			stopRequest.setIndividual(searchRequest.getIndividual());
    			stopRequest.setVehicle(searchRequest.getVehicle());
    
    				
    			stopResponse = this.irpServiceJdbcRepository.getStopDetailsList(stopRequest);
    			stopResponse.setTransactionId(searchRequest.getTransactionId());
    
    			messageList = getMessageList(stopResponse);				
    			if (messageList != null){
    				stopResponse.setMessageList(messageList);
    			}
    			searchResponse = new SearchResponse();
    			searchResponse.setStopResponse(stopResponse);
    			searchResponse.setTransactionId(searchRequest.getTransactionId());			
    		
    		}catch (DataAccessException e){
    			logger.error(e);	
    			e.printStackTrace();
    			throw new DataAccessFailedException("The IRP request to the Destiny Data Access Layer has been failed");
    		}		
    		return searchResponse;
    	}
    
    
    @ServiceActivator(inputChannel="ivsRequest", outputChannel="responseAggregator")
    	public SearchResponse getIvsResponse(SearchRequest searchRequest)
    			throws InvalidDataException, 
    					  DataAccessFailedException,
    					  	 InvalidRegionException, 
    		  		              DatatypeConfigurationException {
    		
    		
    		SearchResponse searchResponse = null;
    		
    		try{
    			
    			IvsResponse ivsResponse;
    			
    			IvsRequest ivsRequest = new IvsRequest();
    			ivsRequest.setOwnerType(searchRequest.getOwnerType());
    			ivsRequest.setPolicyInfo(searchRequest.getPolicyInfo());
    			ivsRequest.setRegion(searchRequest.getRegion());
    			ivsRequest.setTransactionId(searchRequest.getTransactionId());
    			ivsRequest.setTransactionSource(searchRequest.getTransactionSource());
    			ivsRequest.setVerificationDate(searchRequest.getVerificationDate());
    			
    			ivsResponse = this.getInsuranceVerificationResponse.getInsuranceVerificationResponseData(ivsRequest);
    			
    			logger.info("Primary Response :"+ivsResponse.getPrimaryResponse());
    			logger.info("Reason Code :"+ivsResponse.getReasonCode());
    						
    			searchResponse = new SearchResponse();
    			searchResponse.setIvsResponse(ivsResponse);
    			searchResponse.setTransactionId(searchRequest.getTransactionId());
    		}catch (Exception e){
    			logger.error(e);	
    			e.printStackTrace();
    			throw new DataAccessFailedException("The IRP request to the IVS Service has been failed");
    		}		
    		return searchResponse;
    	}
    Last edited by vbose; Sep 4th, 2009 at 03:33 PM.

  3. #13
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Are you always expecting exactly 2 items per-transaction ID?

  4. #14
    Join Date
    Apr 2005
    Posts
    112

    Default

    The answer is NO. However, I made it work once. I changed the correlation strategy from using transaction id to a search id. I have assigned a unique id per search request in the collection of search requests. So the aggregator can now group the search response by search id. But now, it is timing out as I see the debug statements to this effect in the log mentioned below and I am not seeing any response coming back to the client though I could see each service activator API invocation completes the task except the aggregator.

    Code:
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.handler.ServiceActivatingHandler] - handler 'ServiceActivator for [org.springframework.integration.handler.MessageMappingMethodInvoker@e7ccd7]' sending reply Message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.channel.DirectChannel] - preSend on channel 'responseAggregator', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.aggregator.MethodInvokingAggregator] - org.springframework.integration.aggregator.MethodInvokingAggregator@c1429c received message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.util.DefaultMethodInvoker] - Invoking method [public int gov.dc.dmv.destiny.eis.services.irp.service.impl.SearchResponseAggregator.correlateBySearchId(gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse)] with arguments [{gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.util.DefaultMethodInvoker] - Invoking method [public boolean gov.dc.dmv.destiny.eis.services.irp.service.impl.SearchResponseAggregator.completionChecker(java.util.List)] with arguments [{[gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d]}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'responseAggregator', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse@598a5d][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'stopRequest', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.channel.DirectChannel] - preSend on channel 'ivsRequest', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,875 DEBUG [org.springframework.integration.handler.ServiceActivatingHandler] - ServiceActivator for [org.springframework.integration.handler.MessageMappingMethodInvoker@9578c1] received message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:44,890 DEBUG [org.springframework.integration.util.DefaultMethodInvoker] - Invoking method [public gov.dc.dmv.destiny.eis.services.irp.domain.SearchResponse gov.dc.dmv.destiny.eis.services.irp.service.impl.IrpServiceImpl.getIvsResponse(gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest) throws gov.dc.dmv.destiny.eis.services.common.exception.InvalidDataException,gov.dc.dmv.destiny.eis.services.common.exception.DataAccessFailedException,gov.dc.dmv.destiny.eis.services.common.exception.InvalidRegionException,javax.xml.datatype.DatatypeConfigurationException] with arguments [{gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4}]
    
    2009-09-07 00:39:44,921 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.CommonsHttpConnection@3534c1] to [https://web.dcivs.org/verifyinsurance.asmx]
    
    2009-09-07 00:39:57,171 DEBUG [org.springframework.ws.client.MessageTracing.received] - Received response [SaajSoapMessage {http://tempuri.org/IVS/VerifyInsurance}VerifyInsuranceResponse] for request [SaajSoapMessage {http://tempuri.org/IVS/VerifyInsurance}VerifyInsurance]
    
    2009-09-07 00:39:57,171 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'responseAggregator',
    2009-09-07 00:39:57,171 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'ivsRequest', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:57,171 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'searchRequest', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.SearchRequest@7e05c4][Headers={springintegration_sequenceSize=1, springintegration_replyChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4, springintegration_timestamp=1252298384718, springintegration_id=47d26a08-e5f3-419a-bf41-d1fd1d83b8bd, springintegration_correlationId=0cfeb83e-385e-4bbf-924b-58982fa78f88, springintegration_sequenceNumber=1, springintegration_errorChannel=org.springframework.integration.channel.MessageChannelTemplate$TemporaryReplyChannel@b7cee4}]
    2009-09-07 00:39:57,171 DEBUG [org.springframework.integration.channel.DirectChannel] - postSend (sent=true) on channel 'inputRequest', message: [Payload=gov.dc.dmv.destiny.eis.services.irp.domain.IrpSearchRequest@15cb235]
    2009-09-07 00:44:45,595 DEBUG [org.springframework.integration.aggregator.MethodInvokingAggregator] - Handling of Message group with correlation key '1' has timed out.
    2009-09-07 00:44:45,595 DEBUG [org.springframework.integration.aggregator.MethodInvokingAggregator] - Handling of Message group with correlation key '1' has timed out.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •