|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  JMS message getting truncated | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | cmh | 
		  
		    
			  
				 Posted: Fri Nov 07, 2003 7:03 am    Post subject: JMS message getting truncated | 
				     | 
			   
			 
		   | 
		 
		
		   Newbie
 
 Joined: 07 Nov 2003 Posts: 2 Location: MI 
  | 
		  
		    
			  
				I am having JMS trivial message reading program, which is truncating the message to 100 characters, the actual message size is 102500 bytes.
 
code is:
 
	env.put(Context.INITIAL_CONTEXT_FACTORY,initialContextFactory);
 
        env.put(Context.PROVIDER_URL,providerURL);
 
        jndiContext =new InitialContext(env);
 
        // Get JNDI objects
 
        queueConnectionFactory =(QueueConnectionFactory)jndiContext.lookup(qcfName);
 
        queue                  =(Queue)jndiContext.lookup(queueName);
 
        //Get Connection from factory
 
        queueConnection         =queueConnectionFactory.createQueueConnection();
 
        //Start connection
 
        queueConnection.start();
 
        //Create Session
 
        queueSession=queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
 
        //Create Message consumer
 
        queueReceiver=queueSession.createReceiver(queue);
 
        boolean eom=true;
 
        while (eom){
 
            Message m=queueReceiver.receive();
 
            if (m instanceof TextMessage){
 
                System.out.println("Testing -> 111111122223333 <----"+m.toString());
 
            }
 
        }
 
 
Do I need to set message length?
 
IBM java API program retrieves the complete message without any problem.
 
 
Thanks in advance _________________ cmh | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | kingdon | 
		  
		    
			  
				 Posted: Mon Nov 10, 2003 12:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Acolyte
 
 Joined: 14 Jan 2002 Posts: 63 Location: UK 
  | 
		  
		    
			  
				Message.toString() is just a convenience method intended for debug etc. If you want to get the message content then you need to use the type specific accessor methods, e.g. for TextMessage you would use the getText() method.
 
 
Regards,
 
James. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | cmh | 
		  
		    
			  
				 Posted: Mon Nov 10, 2003 12:47 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Newbie
 
 Joined: 07 Nov 2003 Posts: 2 Location: MI 
  | 
		  
		    
			  
				Thanks.   getText() worked. _________________ cmh | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |