Retorno da fila

pessoal,

to tentando desinfileirar arquivos da fila e quando não existe nenhum arquivo na fila, o meu sistema congela dentro do metodo d desinfileiramento e não continua mais.

O meu código eh esse:

    public String desinfileirar(AQSession aq_sess, String nomeFila) throws AQException
    {
	db_conn = ( ( AQOracleSession ) aq_sess ).getDBConnection () ;

	/* Get a handle to queue table - aq_table4 in aqjava schema: */
	q_table = aq_sess.getQueueTable ( SCHEMA_TABLE_QUEUE , NOME_QUEUE_TABLE ) ;
	System.out.println ( "Successful getQueueTable" ) ;

	/* Get a handle to a queue - aq_queue4 in aquser schema: */
	queue = aq_sess.getQueue ( SCHEMA_TABLE_QUEUE , nomeFila ) ;
	System.out.println ( "Successful getQueue" ) ;

	/* Creating a AQDequeueOption object with default options: */
	deq_option = new AQDequeueOption () ;
	
	/* Dequeue a message: */
	message = queue.dequeue ( deq_option ) ;
	
	System.out.println ( "Successful dequeue " ) ;

	/* Retrieve raw data from the message: */
	raw_payload = message.getRawPayload () ;

	b_array = raw_payload.getBytes () ;
		
	return new String(b_array);
    }

quando chega na linha 17, o sistema para lá e não continua execução. Sendo que eu gostaria que voltasse um valor nulo para eu tratar isso.

Alguem sabe como fazer isso?

Não há alguma versão de “dequeue” que aceite um timeout? Olhe a documentação, por favor.