Showing posts with label Tibco EMS. Show all posts
Showing posts with label Tibco EMS. Show all posts

Sunday, June 08, 2008

Tibco EMS Powershell Cmdlet

A little Powershell cmdlet for finding out information about your Tibco EMS topics (or a specific topic).


using System;
using System.Management.Automation;
using TIBCO.EMS.ADMIN;

namespace MarcsPowershellCmdlets
{
[Cmdlet(VerbsCommon.Get, "TibcoTopics", SupportsShouldProcess = true)]
public class GetTibcoTopicsCmdlet : Cmdlet
{
#region Parameters
[Parameter(Position = 0,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The URL of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string URL
{
get; set;
}

[Parameter(Position = 1,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The UserName of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string User
{
get; set;
}

[Parameter(Position = 2,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The Password of the Tibco EMS broker")]
[ValidateNotNullOrEmpty]
public string Password
{
get; set;
}

[Parameter(Position = 3,
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "The name of the topic the look at")]
[ValidateNotNullOrEmpty]
public string Topic
{
get;
set;
}
#endregion

protected override void ProcessRecord()
{
try
{
if (string.IsNullOrEmpty(this.URL))
this.URL = "tcp://localhost:7222";
if (string.IsNullOrEmpty(this.User))
this.User = "admin";

Admin admin = new Admin(this.URL, this.User, this.Password);
TopicInfo[] topics = admin.Topics;

if (string.IsNullOrEmpty(this.Topic))
{
this.WriteObject(topics, true);
}
else
{
foreach (TopicInfo topic in topics)
{
if (topic.Name.Equals(this.Topic, StringComparison.InvariantCultureIgnoreCase))
{
this.WriteObject(topic);
break;
}
}
}

admin.Close();
}
catch (Exception)
{
Console.WriteLine("Cannot connect to the Tibco EMS broker");
}
}
}
}


©2008 Marc Adler - All Rights Reserved

Friday, May 02, 2008

Tibco EMS and WCF

It looks like Tibco is about to announce WCF support for EMS.

Now, *this* is truly exciting news!

Our framework has an entire hand-written communications layer that allows us to communicate over TCP/IP, EMS, various market data systems, MSMQ, etc. We would like nothing more that to gut this layer and replace it with WCF. The missing ingredient has always been EMS support. Now, hopefully, this will be rectified, and hopefully Tibco will offer it to existing EMS customers at no charge.


©2008 Marc Adler - All Rights Reserved