[TIBCO.EMS .NET Admin client library 6.3 documentation]

Returns consumers matching specified filters. Returned array may be of 0 length if there are no consumers in the server which match specified filters.

Namespace:  TIBCO.EMS.ADMIN
Assembly:  TIBCO.EMS.ADMIN (in TIBCO.EMS.ADMIN.dll)

Syntax

public ConsumerInfo[] GetConsumers(
	Object connectionID,
	string username,
	DestinationInfo destination,
	bool durable,
	int dataFlags
)
Public Function GetConsumers ( _
	connectionID As Object, _
	username As String, _
	destination As DestinationInfo, _
	durable As Boolean, _
	dataFlags As Integer _
) As ConsumerInfo()
public:
array<ConsumerInfo^>^ GetConsumers(
	Object^ connectionID, 
	String^ username, 
	DestinationInfo^ destination, 
	bool durable, 
	int dataFlags
)

Parameters

connectionID
Type: System..::.Object
if specified, only consumers for specified connection will be returned. Specify null if all consumers should be returned.
username
Type: System..::.String
if specified, only consumers for connections with specified user name will be returned. Specify null if all consumers should be returned.
destination
Type: TIBCO.EMS.ADMIN..::.DestinationInfo
may be set to null or specify {TopicInfo} or {QueueInfo} object. If specified, only consumers subscribing to destinations of same type and matching this destination name will be returned.
durable
Type: System..::.Boolean
specified that only durable topic subscribers should be returned. This does not affect returned queue consumers. If parameter destination specifies QueueInfo, this parameter is ignored.
dataFlags
Type: System..::.Int32
specifies what information, besides common, should be included into returned ConsumerInfo objects. Value can be any combination of flags {GET_STAT}, {GET_DETAILED_STAT} and {GET_SELECTOR}. Notice {GET_DETAILED_STAT} superceeds {GET_STAT}. If not specified, returned objects do not contain statistics or consumer's selector. Also notice that statistical information may not be returned even when requested if statistics are disabled in the server.

Return Value

array of consumers or array of 0 length.

Remarks

This method returns only consumers matching filters specified by parameters consumerID, username and destination. Parameter durable is applied only to topic subscribers. All filters may be omitted by specifying null value. Parameter durable has special meaning in that it prevents this method from returning non-durable topic consumers. It however does not affect which queue consumers are returned. Returned consumers are not sorted and placed in the array in any order. Application may need to sort the consumers in application-specific order if required.

Examples

  • Calling GetConsumers(null,null,null,false,0); returns all consumers known to server but does not include statistical information nor selector (if present) for each consumer.
  • Calling GetConsumers(null,null,null,true,0); returns all queue consumers and durable topic consumers.
  • Calling
     Copy Code
                          TopicInfo topic = new TopicInfo("news.///");
                          GetConsumers(null,null,topic,true,Admin.GET_DETAILED_STAT);
    returns all durable topic consumers which subscribe to any topic matching topic "news.///". Returned {ConsumerInfo} objects will include detailed statistics about consumers if statistics are enabled in the server but will not include consumer's selector.
  • Calling
     Copy Code
                        QueueInfo queue = new QueueInfo("purchase.order.>");
                        GetConsumers(null,"OrderProcessor",queue,false,
                                       Admin.GET_DETAILED_STAT+Admin.GET_SELECTOR);
    returns all queue consumers created by user "OrderProcessor" and receiving messages from all queues matching name "purchase.order.>". Each consumer object will include full statistics are available for consumer and consumer's selector if present.

Exceptions

ExceptionCondition
System..::.ArgumentException if dataFlags parameter is invalid.
TIBCO.EMS.ADMIN..::.AdminException if not authorized or an error occurred.

See Also