Message/Queue Service

Message API Package / Service consists of Message and Queue APIs.

Message – This module provides Message Service APIs for sending, pulling and removing Message from a particular queue. Asynchronous messages can be sent to a queue that can be pulled through various message already received.

Queue – This module also manages Asynchronous queues and allows you to Create, Delete, Purge messages, View Pending messages and Get all messages in specific queues.

initialize

In order to use various the functions available in a specific API, a developer has to initialize with App42API by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.

Required Parameters

apiKey - The Application key given when the application was created. secretKey - The secret key corresponding to the application key given when the application was created.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; 
App42API.initialize("API_KEY","SECRET_KEY");
App42API.initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
Coming Soon
Coming Soon
App42API::initialize("API_KEY","SECRET_KEY");
Coming Soon
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") 
App42API.initialize("API_KEY","SECRET_KEY");
Coming Soon

Build Service

After initialization, developer needs to call the buildXXXService method on App42API to get the instance of the particular API that you wish to build. For example, To build an instance of Queue Service, buildQueueService() method needs to be called.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
QueueService queueService = App42API.buildQueueService(); 
QueueService queueService = App42API.BuildQueueService();  
QueueService *queueService = [App42API buildQueueService]; 
QueueService queueService = App42API.buildQueueService(); 
QueueService queueService = App42API.buildQueueService(); 
QueueService queueService = App42API.BuildQueueService(); 
Not Available
Coming Soon
Coming Soon
QueueService queueService = App42API.BuildQueueService(); 
$queueService = App42API::buildQueueService();
Coming Soon
queue_service = api.build_queue_service()  
var queueService:QueueService = App42API.buildQueueService(); 
var message:QueueService = App42API.buildQueueService(); 
Coming Soon

Import Statement

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
import com.shephertz.app42.paas.sdk.android.App42API;
import com.shephertz.app42.paas.sdk.android.App42Response;
import com.shephertz.app42.paas.sdk.android.App42Exception;
import com.shephertz.app42.paas.sdk.android.App42BadParameterException;
import com.shephertz.app42.paas.sdk.android.App42NotFoundException;
import com.shephertz.app42.paas.sdk.android.message.Queue;
import com.shephertz.app42.paas.sdk.android.message.QueueService;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.message;
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"   
import com.shephertz.app42.paas.sdk.jme.App42API;
import com.shephertz.app42.paas.sdk.jme.App42Response;
import com.shephertz.app42.paas.sdk.jme.App42Exception;
import com.shephertz.app42.paas.sdk.jme.App42BadParameterException;
import com.shephertz.app42.paas.sdk.jme.App42NotFoundException;
import com.shephertz.app42.paas.sdk.jme.message.Queue;
import com.shephertz.app42.paas.sdk.jme.message.QueueService;
import com.shephertz.app42.paas.sdk.java.App42API;
import com.shephertz.app42.paas.sdk.java.App42Response;
import com.shephertz.app42.paas.sdk.java.App42Exception;
import com.shephertz.app42.paas.sdk.java.App42BadParameterException;
import com.shephertz.app42.paas.sdk.java.App42NotFoundException;
import com.shephertz.app42.paas.sdk.java.message.Queue;
import com.shephertz.app42.paas.sdk.java.message.QueueService;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.message;  
Not Available
Coming Soon
Coming Soon
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.message;  
include_once '../QueueService.php';  
include_once '../App42Log.php';   
include_once '../App42Response.php';  
include_once '../App42Exception.php';   
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php';  
Coming Soon
require 'App42_Ruby_API'
import com.shephertz.app42.paas.sdk.as3.App42API;
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.message.Message;
import com.shephertz.app42.paas.sdk.as3.message.Queue;
import com.shephertz.app42.paas.sdk.as3.message.QueueService;
Coming Soon

Create Pull Queue

Creates a type Pull Queue.

Required Parameters

queueName - The name of the queue which has to be created. queueDescription - Description of the queue.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
String queueDescription = "Description about the queue";
queueService.createPullQueue(queueName, queueDescription, new App42CallBack() {
public void onSuccess(Object response) 
{
	Queue queue  = (Queue)response;
	System.out.println ("queueName is "+ queue.getQueueName () );  
	System.out.println ("queueType is "+ queue.getQueueType () );  
	System.out.println ("queueDescription is "+ queue.getDescription() );
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
String queueName = "MyQueue";
String queueDescription = "Description about the queue.";
queueService.CreatePullQueue(queueName, queueDescription,new Callback());
public class Callback : App42Callback  
{  
    public void OnException(App42Exception exception)  
    {  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;    
		Console.WriteLine("queueName is "+ queue.GetQueueName());
		Console.WriteLine("queueType is "+ queue.GetQueueType()); 
		Console.WriteLine("queueDescription is "+ queue.GetDescription());		
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName =  @"MyQueue";
NSString *queueDescription = @"Description about the queue.";   				
Queue *queue = [queueService createPullQueue:queueName description:description]; 
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString]; 
String queueName = "MyQueue";
String queueDescription = "Description about the queue.";
Queue queue = queueService.createPullQueue(queueName, queueDescription);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
System.out.println("queueDescription is "+ queue.getDescription());
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
String queueDescription = "Description about the queue.";
Queue queue = queueService.createPullQueue(queueName, queueDescription);  
System.out.println ("queueName is "+ queue.getQueueName () );  
System.out.println ("queueType is "+ queue.getQueueType () );  
System.out.println ("queueDescription is "+ queue.getDescription() );
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
String queueDescription = "Description about the queue.";
App42Log.SetDebug(true);    	//Prints output in your editor console
queueService.CreatePullQueue(queueName, queueDescription,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Queue queue = (Queue) response;   
		App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		App42Log.Console("Queue Description : "+ queue.GetDescription());		
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
String queueDescription = "Description about the queue.";
Queue queue = queueService.CreatePullQueue(queueName, queueDescription);  
Console.WriteLine("Queue Name is : "+ queue.GetQueueName());
Console.WriteLine("Queue Type is : "+ queue.GetQueueType()); 
Console.WriteLine("Queue Description : "+ queue.GetDescription());		
String jsonResponse = queue.toString(); 
$queueName = "MyQueue";
$queueDescription = "Description about the queue.";
$queue = $queueService->createPullQueue($queueName, $queueDescription);
print_r("queueName is" . $queue->getQueueName());
print_r("queueType is" . $queue->getQueueType());
print_r("queueDescription is " .$queue->getDescription()); 
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name =  "MyQueue";
queue_description = "Description about the queue.";						
queue = queue_service.create_pull_queue(queue_name, queue_description); 
puts "queueName is #{queue.queue_name}";
puts "queueType is #{queue.queue_type}" ; 
puts "queueDescription is #{queue.queue_description}"; 
json_response = queue.to_s();
var queueName:String = "MyQueue";  
var queueDescription:String = "Description about the queue.";  			
queueService.createPullQueue(queueName, queueDescription,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue1:Queue = Queue(response);
		trace("Queue Name is : " + queue1.getQueueName());
		trace("Queue Type is : " + queue1.getQueueType());
		trace("Description is : " + queue1.getDescription());	
	}
} 
Coming Soon 

Purge Pull Queue

Purges message on the Queue. Note: once the Queue is purged the messages are removed from the Queue and won’t be available for dequeuing.

Required Parameters

queueName - The name of the queue which has to be purged.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
queueService.purgePullQueue(queueName, new App42CallBack() {
public void onSuccess(Object response)
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
queueService.PurgePullQueue(queueName,new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response)response;   
		Console.WriteLine("App42Response is : "+ app42Response);			
		String jsonResponse = app42Response.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
App42Response *response = [queueService purgePullQueue:queueName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String queueName = "MyQueue";
App42Response app42response = queueService.purgePullQueue(queueName); 
boolean  success = app42response.isResponseSuccess();
System.out.println("response is " + app42response);
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
App42Response app42response = queueService.purgePullQueue(queueName); 
boolean  success = app42response.isResponseSuccess();
System.out.println("response is " + app42response) ;
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.PurgePullQueue(queueName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response)response;   
		App42Log.Console("App42Response is :" + app42Response.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
App42Response app42Response = queueService.PurgePullQueue(queueName); 
Console.WriteLine("App42Response is : "+ app42Response);
Boolean  success = app42Response.IsResponseSuccess();
String jsonResponse = app42Response.ToString(); 
$queueName = "MyQueue";
$response = $queueService->purgePullQueue($queueName); 
print_r("Response is : ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
queue_name = "MyQueue";						
response = queue_service.purge_pull_queue(queue_name);  
success = response.is_response_success();
json_response = response.to_s();
var queueName:String = "MyQueue"; 
queueService.purgePullQueue(queueName,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
			var queue1:Queue = Queue(response);
			trace("Queue Name is : " + queue1.getQueueName());
			trace("Description is : " + queue1.getDescription());	
	}
} 
Coming Soon 

Pending Messages

Messages which are pending to be dequeue. Note: Calling this method does not dequeue the messages in the Queue. The messages stay in the Queue till they are dequeued.

Required Parameters

queueName - The name of the queue from which pending messages have to be fetched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
queueService.pendingMessages(queueName,	new App42CallBack() {
public void onSuccess(Object response)
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("messageId is " + message.getMessageId());  
		System.out.println("payLoad is " + message.getPayLoad());       
	}  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
queueService.PendingMessages(queueName, new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;    
		Console.WriteLine("QueueName is : "+ queue.GetQueueName());
		Console.WriteLine("QueueType is : "+ queue.GetQueueType()); 
		Console.WriteLine("QueueDescription is : "+ queue.GetDescription());	
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			Console.WriteLine("CorrelationId is : " + messageList[i].GetCorrelationId());  
			Console.WriteLine("MessageId is : " + messageList[i].GetMessageId());  
			Console.WriteLine("PayLoad is : " + messageList[i].GetPayLoad());       
		}  		
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName =  @"MyQueue";
Queue *queue = [queueService pendingMessages:queueName]; 
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString]; 
String queueName = "MyQueue";
Queue queue = queueService.pendingMessages(queueName);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
Vector messageList = queue.getMessageList();  
for(int i = 0; i < messageList.size(); i++)  
{    
	System.out.println("correlationId is " + ((Queue.Message)messageList.elementAt(i)).getCorrelationId());  
	System.out.println("messageId is " + ((Queue.Message)messageList.elementAt(i)).getMessageId());  
	System.out.println("payLoad is " + ((Queue.Message)messageList.elementAt(i)).getPayLoad());       
}  
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
Queue queue = queueService.pendingMessages(queueName);  
System.out.println("queueName is " + queue.getQueueName());  
System.out.println("queueType is " + queue.getQueueType());  
ArrayList<Queue.Message> messageList = queue.getMessageList();  
for(Queue.Message message : messageList)  
{    
	System.out.println("correlationId is " + message.getCorrelationId());  
	System.out.println("messageId is " + message.getMessageId());  
	System.out.println("payLoad is " + message.getPayLoad());       
}  
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.PendingMessages(queueName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
	{
		Queue queue = (Queue) response;   
    	App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			App42Log.Console("CorrelationId : " + messageList[i].GetCorrelationId());  
			App42Log.Console("MessageId : " + messageList[i].GetMessageId());  
			App42Log.Console("PayLoad : " + messageList[i].GetPayLoad());       
		}  	
        App42Log.Console("JsonResponse :" + queue.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
Queue queue = queueService.PendingMessages(queueName);  
Console.WriteLine("QueueName : "+ queue.GetQueueName());
Console.WriteLine("QueueType : "+ queue.GetQueueType());
	IList<Queue.Message> messageList = queue.GetMessageList();  
	for(int i = 0; i<messageList.Count; i++)  
	{    
		Console.WriteLine("CorrelationId : " + messageList[i].GetCorrelationId());  
		Console.WriteLine("MessageId : " + messageList[i].GetMessageId());  
		Console.WriteLine("PayLoad : " + messageList[i].GetPayLoad());       
	}  		
String jsonResponse = queue.ToString(); 
$queueName = "MyQueue";
$queue = $queueService->pendingMessages($queueName);
print_r("queueName is " . $queue->getQueueName().PHP_EOL);
print_r("queueType is " . $queue->getQueueType().PHP_EOL);
$message = $queue->getMessageList();
foreach($message as $messageList)
{
	print_r("correlationId is " .$messageList->getCorrelationId().PHP_EOL);
	print_r("messageId is " .$messageList->getMessageId().PHP_EOL);
	print_r("payLoad is " .$messageList->getPayLoad().PHP_EOL);
} 
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name = "MyQueue";
queue = queue_service.pending_messages(queue_name);  
puts "queueName is #{queue.queue_name}";
puts "queueType is #{queue.queue_type}";
message_list = Array.new();
message_list = queue.message_list();
for message in message_list do
  puts "correlationId is #{message.correlation_id}";
  puts "messageId is #{message.message_id}";
  puts "payLoad is #{message.pay_load}";
end
json_response = queue.to_s();
var queueName:String = "MyQueue";
queueService.pendingMessages(queueName,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue1:Queue = Queue(response);
		trace("Queue Name is : " + queue1.getQueueName());
		trace("Queue Type is : " + queue1.getQueueType());	
		if(queue1.getMessageList().length > 0)
		{
			for(var j:int=0;j<queue1.getMessageList().length;j++)
			{
				trace("Correlation id is : " + Message(queue1.getMessageList()[j]).getCorrelationId());
				trace("Message is " + Message(queue1.getMessageList()[j]).getMessageId());
				trace("PayLoad is " + Message(queue1.getMessageList()[j]).getPayLoad());
			}
		}
	}
} 
Coming Soon 

Get Messages

Messages are retrieved and dequeued from the Queue.

Required Parameters

queueName - The name of the queue which have to be retrieved. receiveTimeOut - Receive timed out (in milliseconds).

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
queueService.getMessages(queueName, receiveTimeOut, new App42CallBack() {
public void onSuccess(Object response) 
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("messageId is " + message.getMessageId());  
		System.out.println("payLoad is " + message.getPayLoad());     
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
queueService.GetMessages(queueName, receiveTimeOut,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;    
		Console.WriteLine("QueueName is : "+ queue.GetQueueName());
		Console.WriteLine("QueueType is : "+ queue.GetQueueType()); 
		Console.WriteLine("QueueDescription is : "+ queue.GetDescription());	
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			Console.WriteLine("CorrelationId is : " + messageList[i].GetCorrelationId());  
			Console.WriteLine("MessageId is : " + messageList[i].GetMessageId());  
			Console.WriteLine("PayLoad is : " + messageList[i].GetPayLoad());       
		}  		 
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
long receiveTimeOut = 10000;				     
Queue *queue = [queueService getMessages:queueName  receiveTimeOut:receiveTimeOut];
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString];  
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.getMessages(queueName, receiveTimeOut);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
Vector messageList = queue.getMessageList();  
for(int i = 0; i < messageList.size(); i++)  
{    
	System.out.println("correlationId is " + ((Queue.Message)messageList.elementAt(i)).getCorrelationId());  
	System.out.println("messageId is " + ((Queue.Message)messageList.elementAt(i)).getMessageId());  
	System.out.println("payLoad is " + ((Queue.Message)messageList.elementAt(i)).getPayLoad());       
}  
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.getMessages(queueName, receiveTimeOut);  
System.out.println("queueName is " + queue.getQueueName());  
System.out.println("queueType is " + queue.getQueueType());  
ArrayList<Queue.Message> messageList = queue.getMessageList();  
for(Queue.Message message : messageList)  
{    
	System.out.println("correlationId is " + message.getCorrelationId());  
	System.out.println("messageId is " + message.getMessageId());  
	System.out.println("payLoad is " + message.getPayLoad());     
} 
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.GetMessages(queueName, receiveTimeOut,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
		Queue queue = (Queue) response;   
    	App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			App42Log.Console("CorrelationId : " + messageList[i].GetCorrelationId());  
			App42Log.Console("MessageId : " + messageList[i].GetMessageId());  
			App42Log.Console("PayLoad : " + messageList[i].GetPayLoad());       
		}  	
        App42Log.Console("JsonResponse :" + queue.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.GetMessages(queueName, receiveTimeOut);  
Console.WriteLine("QueueName : "+ queue.GetQueueName());
Console.WriteLine("QueueType : "+ queue.GetQueueType());
	IList<Queue.Message> messageList = queue.GetMessageList();  
	for(int i = 0; i<messageList.Count; i++)  
	{    
		Console.WriteLine("CorrelationId : " + messageList[i].GetCorrelationId());  
		Console.WriteLine("MessageId : " + messageList[i].GetMessageId());  
		Console.WriteLine("PayLoad : " + messageList[i].GetPayLoad());       
	}  		
String jsonResponse = queue.ToString(); 
$queueName = "MyQueue";
$receiveTimeOut = 10000;
$queue = $queueService->getMessages($queueName, $receiveTimeOut);
print_r("queueName is " . $queue->getQueueName().PHP_EOL);
print_r("queueType is " . $queue->getQueueType().PHP_EOL);
$message = $queue->getMessageList();
foreach($message as $messageList)
{
	print_r("correlationId is " .$messageList->getCorrelationId().PHP_EOL);
	print_r("messageId is " .$messageList->getMessageId().PHP_EOL);
	print_r("payLoad is " .$messageList->getPayLoad().PHP_EOL);
}
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name = "MyQueue";
receive_time_out = 10000;						
queue = queue_service.get_messages(queue_name, receive_time_out);  
puts "queueName is #{queue.queue_name}";
puts "queueType is #{queue.queue_type}";
message_list = Array.new();
message_list = queue.message_list();
for message in message_list do
  puts "correlationId is #{message.correlation_id}";
  puts "messageId is #{message.message_id}";
  puts "payLoad is #{message.pay_load}";
end
json_response = queue.to_s(); 
var queueName:String = "MyQueue";
var receiveTimeOut:int = 10000;  
message.getMessages(queueName, receiveTimeOut,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue1:Queue = Queue(response);
		trace("Queue Name is : " + queue1.getQueueName());
		trace("Queue Type is : " + queue1.getQueueType());	
		if(queue1.getMessageList().length > 0)
		{
			for(var j:int=0;j<queue1.getMessageList().length;j++)
			{
				trace("Correlation id is : " + Message(queue1.getMessageList()[j]).getCorrelationId());
				trace("Message is " + Message(queue1.getMessageList()[j]).getMessageId());
				trace("PayLoad is " + Message(queue1.getMessageList()[j]).getPayLoad());
			}
		}
	}
}
Coming Soon 

Send Messages

Send message on the queue with an expire time. The message will expire if it is not pulled/dequeued before the expire.

queueName - The name of the queue to which his message has to be sent. message - Message that has to be sent. expiryTime - Message expire time.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
queueService.sendMessage(queueName, message, expiryTime, new App42CallBack() {
public void onSuccess(Object response)
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("payLoad is " + message.getPayLoad());     
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
queueService.SendMessage(queueName, message, expiryTime,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;    
		Console.WriteLine("QueueName is : "+ queue.GetQueueName());
		Console.WriteLine("QueueType is : "+ queue.GetQueueType()); 
		Console.WriteLine("QueueDescription is : "+ queue.GetDescription());	
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			Console.WriteLine("CorrelationId is : " + messageList[i].GetCorrelationId()); 
			Console.WriteLine("PayLoad is : " + messageList[i].GetPayLoad());       
		}  		  
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
NSString *message = @"App42 Message API.";
long expiryTime = 10000;				     
Queue *queue = [queueService sendMessage:queueName message:message  expiryTime:expiryTime];
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString];  
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
Queue queue = queueService.sendMessage(queueName,message, expiryTime);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
Vector messageList = queue.getMessageList();
for(int i = 0; i < messageList.size(); i++)  
{    
	System.out.println("correlationId is " + ((Queue.Message)messageList.elementAt(i)).getCorrelationId());
	System.out.println("payLoad is " + ((Queue.Message)messageList.elementAt(i)).getPayLoad());       
}  
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
Queue queue = queueService.sendMessage(queueName,message, expiryTime);  
System.out.println("queueName is " + queue.getQueueName());  
System.out.println("queueType is " + queue.getQueueType());  
ArrayList<Queue.Message> messageList = queue.getMessageList();  
for(Queue.Message message : messageList)  
{    
	System.out.println("correlationId is " + message.getCorrelationId());  
	System.out.println("payLoad is " + message.getPayLoad());     
} 
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.SendMessage(queueName, message, expiryTime,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
    	Queue queue = (Queue) response;      
    	App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			App42Log.Console("CorrelationId : " + messageList[i].GetCorrelationId());  
			App42Log.Console("PayLoad : " + messageList[i].GetPayLoad());       
		}  	
        App42Log.Console("JsonResponse :" + queue.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
String message = "App42 Message API.";
long  expiryTime = 10000;
Queue queue = queueService.SendMessage(queueName,message, expiryTime);  
Console.WriteLine("QueueName : "+ queue.GetQueueName());
Console.WriteLine("QueueType : "+ queue.GetQueueType());
	IList<Queue.Message> messageList = queue.GetMessageList();  
	for(int i = 0; i<messageList.Count; i++)  
	{    
		Console.WriteLine("CorrelationId : " + messageList[i].GetCorrelationId());  
		Console.WriteLine("PayLoad : " + messageList[i].GetPayLoad());       
	}  		
String jsonResponse = queue.ToString(); 
$queueName = "MyQueue";
$message = "App42 Message API.";
$expiryTime = 10000;
$queue = $queueService->sendMessage($queueName,$message, $expiryTime);
print_r("queueName is " . $queue->getQueueName().PHP_EOL);
print_r("queueType is " . $queue->getQueueType().PHP_EOL);
$message = $queue->getMessageList();
foreach($message as $messageList)
{
	print_r("correlationId is " .$messageList->getCorrelationId().PHP_EOL);
	print_r("payLoad is " .$messageList->getPayLoad().PHP_EOL);
}
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name = "MyQueue";
msg = "Message";
exp = 100000;					
queue = queue_service.send_message(queue_name, msg, exp); 
puts "queueName is #{queue.queue_name }";
puts "queueType is #{queue.queue_type}";
message_list = Array.new();
message_list = queue.message_list();
for message in message_list do
  puts "correlationId is #{message.correlation_id}";
  puts "payLoad is #{message.pay_load}";
end
json_response = queue.to_s();
var queueName:String = "MyQueue";  
var message:String  = "App42 Message API.";  
var expiryTime:int = 10000;  
message.sendMessage(queueName, message, expiryTime,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue:Queue = Queue(response);
		trace("Queue Name is : " + queue.getQueueName());
		trace("Queue Type is : " + queue.getQueueType());	
		if(queue.getMessageList().length > 0)
		{
			for(var j:int=0;j<queue.getMessageList().length;j++)
			{
				trace("Correlation id is : " + Message(queue.getMessageList()[j]).getCorrelationId());
				trace("PayLoad is " + Message(queue.getMessageList()[j]).getPayLoad());
			}
		}
	}
} 
Coming Soon 

Receive Message

Pull all the message from the queue.

Required Parameters

queueName - The name of the queue from which messages have to be pulled. receiveTimeOut - Receive timed out (in milliseconds).

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
queueService.receiveMessage(queueName, receiveTimeOut, new App42CallBack() {
public void onSuccess(Object response) 
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("messageId is " + message.getMessageId());  
		System.out.println("payLoad is " + message.getPayLoad());    
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
queueService.ReceiveMessage(queueName, receiveTimeOut,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;    
		Console.WriteLine("QueueName is : "+ queue.GetQueueName());
		Console.WriteLine("QueueType is : "+ queue.GetQueueType()); 
		Console.WriteLine("QueueDescription is : "+ queue.GetDescription());	
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			Console.WriteLine("CorrelationId is : " + messageList[i].GetCorrelationId());  
			Console.WriteLine("MessageId is : " + messageList[i].GetMessageId());  
			Console.WriteLine("PayLoad is : " + messageList[i].GetPayLoad());       
		}  		  
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
long receiveTimeOut = 10000;				     
Queue *queue = [queueService receiveMessage:queueName  receiveTimeOut:receiveTimeOut];
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString];  
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.receiveMessage(queueName, receiveTimeOut);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
Vector messageList = queue.getMessageList();
for(int i = 0; i < messageList.size(); i++)  
{    
	System.out.println("correlationId is " + ((Queue.Message)messageList.elementAt(i)).getCorrelationId());  
	System.out.println("messageId is " + ((Queue.Message)messageList.elementAt(i)).getMessageId());  
	System.out.println("payLoad is " + ((Queue.Message)messageList.elementAt(i)).getPayLoad());       
} 
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.receiveMessage(queueName, receiveTimeOut);  
System.out.println("queueName is " + queue.getQueueName());  
System.out.println("queueType is " + queue.getQueueType());  
ArrayList<Queue.Message> messageList = queue.getMessageList();  
for(Queue.Message message : messageList)  
{    
	System.out.println("correlationId is " + message.getCorrelationId());  
	System.out.println("messageId is " + message.getMessageId());  
	System.out.println("payLoad is " + message.getPayLoad());    
} 
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.ReceiveMessage(queueName, receiveTimeOut, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        Queue queue = (Queue) response;    
    	App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			App42Log.Console("CorrelationId : " + messageList[i].GetCorrelationId());  
			App42Log.Console("MessageId : " + messageList[i].GetMessageId());  
			App42Log.Console("PayLoad : " + messageList[i].GetPayLoad());       
		}  	
        App42Log.Console("JsonResponse :" + queue.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
Queue queue = queueService.ReceiveMessage(queueName, receiveTimeOut);   
Console.WriteLine("QueueName : "+ queue.GetQueueName());
Console.WriteLine("QueueType : "+ queue.GetQueueType());
	IList<Queue.Message> messageList = queue.GetMessageList();  
	for(int i = 0; i<messageList.Count; i++)  
	{    
		Console.WriteLine("CorrelationId : " + messageList[i].GetCorrelationId());  
		Console.WriteLine("MessageId : " + messageList[i].GetMessageId());  
		Console.WriteLine("PayLoad : " + messageList[i].GetPayLoad());       
	}  		
String jsonResponse = queue.ToString(); 
$queueName = "MyQueue";
$receiveTimeOut = 10000;
$queue = $queueService->receiveMessage($queueName, $receiveTimeOut);
print_r("queueName is " . $queue->getQueueName().PHP_EOL);
print_r("queueType is " . $queue->getQueueType().PHP_EOL);
$message = $queue->getMessageList();
foreach($message as $messageList)
{
	print_r("correlationId is " .$messageList->getCorrelationId().PHP_EOL);
	print_r("messageId is " .$messageList->getMessageId().PHP_EOL);
	print_r("payLoad is " .$messageList->getPayLoad().PHP_EOL);
}
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name ="MyQueue";
receive_time_out = 10000;						
queue = queue_service.receive_message(queue_name, receive_time_out); 
puts "queueName is #{queue.queue_name}";
puts "queueType is #{queue.queue_type}";
message_list = Array.new();
message_list = queue.message_list();
for message in message_list
  puts "correlationId is #{message.correlation_id}";
  puts "messageId is #{message.message_id}";
  puts "payLoad is #{message.pay_load}";
end
json_response = queue.to_s();
var queueName:String = "MyQueue"; 
var receiveTimeOut:int = 10000;  
message.receiveMessage(queueName, receiveTimeOut,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue1:Queue = Queue(response);
		trace("Queue Name is : " + queue1.getQueueName());
		trace("Queue Type is : " + queue1.getQueueType());	
		if(queue1.getMessageList().length > 0)
		{
			for(var j:int=0;j<queue1.getMessageList().length;j++)
			{
				trace("Correlation id is : " + Message(queue1.getMessageList()[j]).getCorrelationId());
				trace("Message is " + Message(queue1.getMessageList()[j]).getMessageId());
				trace("PayLoad is " + Message(queue1.getMessageList()[j]).getPayLoad());
			}
		}
	}
}
Coming Soon 

Receive Message By Correlation Id

Pull message based on the correlation id.

Required Parameters

queueName - The name of the queue from which messages have to be pulled. receiveTimeOut - Receive timed out (in milliseconds). correlationId - Correlation Id for which message has to be pulled.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
queueService.receiveMessageByCorrelationId(queueName, receiveTimeOut, correlationId, new App42CallBack() {
public void onSuccess(Object response) 
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("messageId is " + message.getMessageId());  
		System.out.println("payLoad is " + message.getPayLoad());    
	} 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
queueService.ReceiveMessageByCorrelationId(queueName, receiveTimeOut,correlationId,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;     
		Console.WriteLine("QueueName is : "+ queue.GetQueueName());
		Console.WriteLine("QueueType is : "+ queue.GetQueueType()); 
		Console.WriteLine("QueueDescription is : "+ queue.GetDescription());	
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			Console.WriteLine("CorrelationId is : " + messageList[i].GetCorrelationId());  
			Console.WriteLine("MessageId is : " + messageList[i].GetMessageId());  
			Console.WriteLine("PayLoad is : " + messageList[i].GetPayLoad());       
		}  		
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
long receiveTimeOut = 10000;			
NSString *correlationId = @"Correlation Id";	     
Queue *queue = [queueService receiveMessageByCorrelationId:queueName  receiveTimeOut:receiveTimeOut correlationId:correlationId];
NSLog(@"queueName is = %@",queue.queueName);
NSLog(@"queueType is= %@",queue.queueType);
NSString *jsonResponse = [queue toString];  
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
Queue queue = queueService.receiveMessageByCorrelationId(queueName, receiveTimeOut,correlationId);  
System.out.println("queueName is "+ queue.getQueueName());
System.out.println("queueType is "+ queue.getQueueType());
Vector messageList = queue.getMessageList();
for(int i = 0; i < messageList.size(); i++)  
{    
	System.out.println("correlationId is " + ((Queue.Message)messageList.elementAt(i)).getCorrelationId());  
	System.out.println("messageId is " + ((Queue.Message)messageList.elementAt(i)).getMessageId());  
	System.out.println("payLoad is " + ((Queue.Message)messageList.elementAt(i)).getPayLoad());       
}
String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
Queue queue = queueService.receiveMessageByCorrelationId(queueName, receiveTimeOut,correlationId);  System.out.println("queueName is " + queue.getQueueName());  
System.out.println("queueType is " + queue.getQueueType());  
ArrayList<Queue.Message> messageList = queue.getMessageList();  
for(Queue.Message message : messageList)  
{    
	System.out.println("correlationId is " + message.getCorrelationId());  
	System.out.println("messageId is " + message.getMessageId());  
	System.out.println("payLoad is " + message.getPayLoad());    
} String jsonResponse = queue.toString(); 
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.ReceiveMessageByCorrelationId(queueName, receiveTimeOut, correlationId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        Queue queue = (Queue) response;     
    	App42Log.Console("QueueName :" + queue.GetQueueName());
		App42Log.Console("QueueType :" + queue.GetQueueType());
		IList<Queue.Message> messageList = queue.GetMessageList();  
		for(int i = 0; i<messageList.Count; i++)  
		{    
			App42Log.Console("CorrelationId : " + messageList[i].GetCorrelationId());  
			App42Log.Console("MessageId : " + messageList[i].GetMessageId());  
			App42Log.Console("PayLoad : " + messageList[i].GetPayLoad());       
		}  	
        App42Log.Console("JsonResponse :" + queue.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
long  receiveTimeOut = 10000;
String correlationId = "Correlation Id";
Queue queue = queueService.ReceiveMessageByCorrelationId(queueName, receiveTimeOut,correlationId);  
Console.WriteLine("QueueName : "+ queue.GetQueueName());
Console.WriteLine("QueueType : "+ queue.GetQueueType());
	IList<Queue.Message> messageList = queue.GetMessageList();  
	for(int i = 0; i<messageList.Count; i++)  
	{    
		Console.WriteLine("CorrelationId : " + messageList[i].GetCorrelationId());  
		Console.WriteLine("MessageId : " + messageList[i].GetMessageId());  
		Console.WriteLine("PayLoad : " + messageList[i].GetPayLoad());       
	}  		
String jsonResponse = queue.ToString(); 
$queueName = "MyQueue";
$receiveTimeOut = 10000;
$correlationId = "Correlation Id";
$queue = $queueService->receiveMessageByCorrelationId($queueName, $receiveTimeOut,$correlationId);
print_r("queueName is " . $queue->getQueueName().PHP_EOL);
print_r("queueType is " . $queue->getQueueType().PHP_EOL);
$message = $queue->getMessageList();
foreach($message as $messageList)
{
	print_r("correlationId is " .$messageList->getCorrelationId().PHP_EOL);
	print_r("messageId is " .$messageList->getMessageId().PHP_EOL);
	print_r("payLoad is " .$messageList->getPayLoad().PHP_EOL);
} 
$jsonResponse = $queue->toString(); 
Coming Soon
queue_name = "MyQueue";
receive_time_out = 10000;
correlation_id = "Correlation Id";						
queue = queue_service.receive_message_by_correlation_id(queue_name, receive_time_out, correlation_id);  
puts "queueName is #{queue.queue_name}";
puts "queueType is #{queue.queue_type}";
message_list = Array.new();
message_list = queue.message_list();
for message in message_list do
  puts "correlationId is #{message.correlation_id}";
  puts "messageId is #{message.message_id}";
  puts "payLoad is #{message.pay_load}";
end
json_response = queue.to_s();
var queueName:String = "MyQueue"; 
var receiveTimeOut:int = 10000;  
var correlationId:String = "Correlation Id";  
message.receiveMessageByCorrelationId(queueName, receiveTimeOut,correlationId,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var queue1:Queue = Queue(response);
		trace("Queue Name is : " + queue1.getQueueName());
		trace("Queue Type is : " + queue1.getQueueType());	
		if(queue1.getMessageList().length > 0)
		{
			for(var j:int=0;j<queue1.getMessageList().length;j++)
			{
				trace("Correlation id is : " + Message(queue1.getMessageList()[j]).getCorrelationId());
				trace("Message is " + Message(queue1.getMessageList()[j]).getMessageId());
				trace("PayLoad is " + Message(queue1.getMessageList()[j]).getPayLoad());
			}
		}
	}
}
Coming Soon 

Remove Message

Remove message from the queue based on the message id. Note: Once the message is removed it cannot be pulled.

Required Parameters

queueName - The name of the queue from which the message has to be removed. messageId - The message id of the message which has to be removed.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
String messageId = "Message Id";
queueService.removeMessage(queueName, messageId, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
String messageId = "Message Id";
queueService.RemoveMessage(queueName,messageId,new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response; 
		Console.WriteLine("App42Response is : " + app42response) ;  		
		String jsonResponse = app42response.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
NSString *messageId = @"Message Id";
App42Response *response = [queueService removeMessage:queueName messageId:messageId]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String queueName = "MyQueue";
String messageId = "Message Id";
App42Response app42response = queueService.removeMessage(queueName,messageId); 
boolean  success = app42response.isResponseSuccess();
System.out.println("response is " + app42response);
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
String messageId = "Message Id";
App42Response app42response = queueService.removeMessage(queueName,messageId); 
System.out.println("response is " + app42response);
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
String messageId = "Message Id";
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.RemoveMessage(queueName,messageId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        App42Response app42Response = (App42Response) response;   
        App42Log.Console("App42Response is :" + app42Response.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
String messageId = "Message Id";
App42Response app42response = queueService.RemoveMessage(queueName,messageId); 
Console.WriteLine("App42Response is : " + app42response) ;  
Boolean  success = app42response.IsResponseSuccess();
String jsonResponse = app42response.ToString(); 
$queueName = "MyQueue";
$messageId = "Message Id";
$response = $queueService->removeMessage($queueName,$messageId); 
print_r("Response is : ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
queue_name = "MyQueue";
message_id = "Message Id";
response = queue_service.remove_message(queue_name, message_id); 
success = response.is_response_success();
json_response = response.to_s()
var queueName:String = "MyQueue"; 
var messageId:String = "Message Id";  
message.removeMessage(queueName,messageId,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var app42response :App42Response= App42Response(response);      
		trace("response is " + app42response)   	
	}
}
Coming Soon 

Delete Pull Queue

Delete the Pull type Queue.

Required Parameters

queueName - The name of the queue which has to be deleted.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
queueService.deletePullQueue(queueName, new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ; 
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String queueName = "MyQueue";
queueService.DeletePullQueue(queueName,new Callback()); 
public class Callback : App42Callback  
{   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response; 
		Console.WriteLine("App42Response is : " + app42response) ;  		
		String jsonResponse = app42response.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
App42Response *response = [queueService deletePullQueue:queueName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String queueName = "MyQueue";
App42Response app42response = queueService.deletePullQueue(queueName); 
boolean  success = app42response.isResponseSuccess();
System.out.println("response is " + app42response); 
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
App42Response app42response = queueService.deletePullQueue(queueName); 
System.out.println("response is " + app42response) ; 
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String queueName = "MyQueue";
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.DeletePullQueue(queueName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        App42Response app42Response = (App42Response) response;   
        App42Log.Console("App42Response is :" + app42Response.ToString());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
App42Response app42response = queueService.DeletePullQueue(queueName); 
Console.WriteLine("App42Response is : " + app42response) ;  
Boolean  success = app42response.IsResponseSuccess();
String jsonResponse = app42response.ToString(); 
$queueName = "MyQueue";
$response = $queueService->deletePullQueue($queueName); 
print_r("Response is : ".$response->toString().PHP_EOL);
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
queue_name = "MyQueue";						
response = queue_service.delete_pull_queue(queue_name); 
success = response.is_response_success();
json_response = response.to_s();
var queueName:String = "MyQueue"; 
queueService.deletePullQueue(queueName,new callback());
class callback implements App42CallBack
{	
	public function onException(exception:App42Exception):void
	{
		trace("Exception Message " + exception);
	}
	public function onSuccess(response:Object):void
	{					
		var app42response :App42Response= App42Response(response);      
		trace("response is " + app42response)   	
	}
}
Coming Soon 

Exception Handling

The functions available under Message/Queue API can throw some exceptions in abnormal conditions. Example of the same has been given below. E.g. If an App developer is sending a message on the queue which has not been created, the function will throw the App42Exception (as shown below) with message as “Not Found” and the appErrorCode as “2400” and the details as “Queue with the name ‘@queueName’ not found”.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for Corona
  • create User Api for Cocos2DX
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
queueService.sendMessage(queueName, msg, exp, new App42CallBack() {
public void onSuccess(Object response) 
{
	Queue queue  = (Queue)response;
	System.out.println("queueName is " + queue.getQueueName());  
	System.out.println("queueType is " + queue.getQueueType());  
	ArrayList<Queue.Message> messageList = queue.getMessageList();  
	for(Queue.Message message : messageList)  
	{    
		System.out.println("correlationId is " + message.getCorrelationId());  
		System.out.println("payLoad is " + message.getPayLoad());     
	} 
}
public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 2400)
	{
	// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
	// Handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
	// Handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 	
}
});	       
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
queueService.SendMessage(queueName, msg, exp, new Callback()); 
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
		String jsonText = exception.GetMessage(); 
	}  
	public void OnSuccess(Object response)  
	{  
		Queue queue = (Queue) response;
		String jsonResponse = queue.ToString();  
	}  
}  
NSString *queueName = @"MyQueue";
NSString *msg = @"Message";
long exp = 100000;
@try{
    Queue *queue = [queueService sendMessage:queueName message:msg expiryTime:exp];
} @catch(App42Exception *ex) {
	int appErrorCode = ex.appErrorCode;
	int httpErrorCode = ex.httpErrorCode;
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	NSString *jsonText = exception.reason; 	
}                        
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
try
{
	Queue queue = queueService.sendMessage(queueName, msg, exp);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.getAppErrorCode();
	int httpErrorCode = ex.getHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 	
}
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
try
{
	Queue queue = queueService.sendMessage(queueName, msg, exp);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.getAppErrorCode();
	int httpErrorCode = ex.getHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 	
}
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
App42Log.SetDebug(true);        //Prints output in your editor console
queueService.SendMessage(queueName, msg, exp, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
    
	public void OnException(Exception e)
	{
	App42Exception ex = (App42Exception)e;
	int appErrorCode = ex.GetAppErrorCode();
    int httpErrorCode = ex.GetHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.GetMessage(); 	
	}
    
    public void OnSuccess(object response)
    { 
        App42Log.Console("response is :" + response.ToString());
    }
}
Not Available
Coming Soon
Coming Soon
String queueName = "MyQueue";
String msg = "Message";
long exp = 100000;
try
{
	Queue queue = queueService.SendMessage(queueName, msg, exp);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.GetAppErrorCode();
	int httpErrorCode = ex.GetHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName> not found.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.GetMessage(); 	
}      
$queueName = "MyQueue";
$msg = "Message";
$exp = 100000;
try{
	$queue = $queueService->sendMessage($queueName, $msg, $exp);
   }
catch(App42Exception $ex) 
{
	$appErrorCode = $ex->getAppErrorCode();
	$httpErrorCode = $ex->getHttpErrorCode();
	if(appErrorCode == 2400)
	{
		// Handle here for Not Found (Queue with the name '@queueName' not found.)
	}
		else if(appErrorCode == 1401){
		// handle here for Client is not authorized
	}
		else if(appErrorCode == 1500){
		// handle here for Internal Server Error
	}
	$jsonText = $ex->getMessage(); /* returns the Exception text in JSON format. (as shown below)*/	
}
Coming Soon
    Coming Soon
Coming Soon 
    Coming Soon

Error Codes

Functions in Message API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):

1400 - BAD REQUEST - The Request parameters are invalid. 1401 - UNAUTHORIZED - Client is not authorized. 1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again. 2400 - NOT FOUND - Queue with the name '@queueName' not found. 2401 - NOT FOUND - Queue with the name '@queueName' does not have any messages. 2402 - NOT FOUND - Queue with the name '@queueName' and correlationId '@correlationId' does not have any messages. 2403 - BAD REQUEST - Queue by the name '@queueName' already exists. 2404 - BAD REQUEST - The request parameters are invalid. This action is only applicable for PULL type queue. 2405 - NOT FOUND - Queue with the name '@queueName' does not have any pending messages.