Plugin to send Bug data to external Webservice

22 views
Skip to first unread message

Vyacheslav Volov

unread,
Feb 19, 2013, 7:44:54 AM2/19/13
to devtarge...@googlegroups.com

Hi,

 

I’m looking at developing a Plugin that sends data to an external WebService whenever a new bug is created or when an existing bug is updated.

 

Here is my starting code:

 

using System;

using System.IO;

using System.Net;

using System.Runtime.Serialization;

using System.Xml.Linq;

using NServiceBus.Saga;

using Tp.Integration.Plugin.Common;

using Tp.Integration.Messages;

using Tp.Integration.Messages.EntityLifecycle.Messages;

using NServiceBus;

 

[assemblyPluginAssembly("Testing Plugin")]

 

//If you rename or remove this file, it will be re-created during package update.

namespace PluginTestJuan

{

  [ProfileDataContract]

  public class Profile

  {

 

    public class CreateTasksForNewUserStoryHandler : IHandleMessages<UserStoryCreatedMessage>,

      IHandleMessages<UserStoryUpdatedMessage>,

      IHandleMessages<BugCreatedMessage>,

      IHandleMessages<BugUpdatedMessage>

    {

      public Logit _logit = new Logit("c:\\logs\\profile");

 

 

      public void Handle(UserStoryCreatedMessage message)

      {

        var mst = message.Dto.UserStoryID.ToString();

        Log(mst);

      }

 

      public void Handle(UserStoryUpdatedMessage message)

      {

        var mst = message.Dto.UserStoryID.ToString();

        Log(mst);

      }

 

 

      public void Handle(BugCreatedMessage message)

      {

        var mst = message.Dto.BugID.ToString();

        Log(mst);

      }

 

      public void Handle(BugUpdatedMessage message)   //BugCreatedMessage message)

      {

        var mst = message.Dto.BugID.ToString();

        Log(mst);

      }

 

     

      public void Log(string msg)

      {

        _logit.log(msg);

      }

 

    }

  }

}

 

 

Unfortunately, nothing is being logged.

Can you advise?

 

Any help = much appreciated!!!

 

 

Regards, Mark.

SERGEY TRUHTANOV

unread,
Feb 19, 2013, 9:05:35 AM2/19/13
to devtarge...@googlegroups.com
Hello.
You should create a profile for your plugin to make it react on chages.

Feel free to ask if you have more questions

mpo...@huronconsultinggroup.com

unread,
Feb 19, 2013, 10:42:01 AM2/19/13
to devtarge...@googlegroups.com
I believe I have a profile. Or rather, in TargetProcess >> Settings >> Plugins , I can see the Plugin, and have added a new 'Profile' named 'TPPluginTest'.
I do see activity in the NServiceBus.Host command window.
But I do not seem to respond to any  messages in my Plugin.
Is it possible to debug this app while it's running?
-Mark.

mpo...@huronconsultinggroup.com

unread,
Feb 19, 2013, 10:59:15 AM2/19/13
to devtarge...@googlegroups.com
It's working!
Thanks for the guidance to the Profile info.
 
Regards, Mark.

On Tuesday, February 19, 2013 6:05:35 AM UTC-8, SERGEY TRUHTANOV wrote:

nasre...@gmail.com

unread,
Apr 19, 2013, 9:30:10 AM4/19/13
to devtarge...@googlegroups.com
Hi,
 
Can you tell me how is it resolved and working for you? Because I am logging the data in a text file whenever a bug is created/updated. I can see the plugin in TargetProcess >> Settings >> Plugins. But the data is not getting logged in the text file. I am using the similar code structure like you. Any help is highly appreciated.
 
Thanks,
Nasreen.
Reply all
Reply to author
Forward
0 new messages