Skip to content

Instantly share code, notes, and snippets.

@GeradeDev
Created July 17, 2020 10:05
Show Gist options
  • Save GeradeDev/77894767253560dd0193088d1b758d05 to your computer and use it in GitHub Desktop.
Save GeradeDev/77894767253560dd0193088d1b758d05 to your computer and use it in GitHub Desktop.
[Binding]
[AttributeUsage(AttributeTargets.Parameter)]
public class RabbitMqTriggerAttribute : Attribute
{
public string HostName { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Port { get; set; }
public string Connection { get; set; }
public string QueueName { get; set; }
public RabbitMqTriggerAttribute(string queueName)
{
QueueName = queueName;
}
public void LoadRabbitSettings()
{
HostName = Environment.GetEnvironmentVariable("HostName");
Username = Environment.GetEnvironmentVariable("HostUsername");
Password = Environment.GetEnvironmentVariable("Password");
Port = Environment.GetEnvironmentVariable("Port");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment