GithubHelp home page GithubHelp logo

isabella232 / azure-functions-rabbitmq-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure/azure-functions-rabbitmq-extension

0.0 0.0 0.0 283 KB

RabbitMQ extension for Azure Functions

License: MIT License

C# 94.21% Java 5.67% Batchfile 0.13%

azure-functions-rabbitmq-extension's Introduction

RabbitMQ Extension for Azure Functions

Build Status

This repository hosts RabbitMQ trigger and output bindings to interact with RabbitMQ in your Azure Functions and WebJobs. More specifically, the trigger binding enables invoking a function when a message arrives at the RabbitMQ queue. The triggered function can consume this message and take required action. Similarly, the output binding facilitates publishing of messages on the RabbitMQ queue.

Usage

The following example shows a C# function that gets invoked (by virtue of the trigger binding) when a message is added to a RabbitMQ queue named inputQueue. The function then logs the message string, composes an output message and returns it. This value is then published to the queue named outputQueue through the output binding. The example function dictates that the connection URI for the RabbitMQ service is the one with key RabbitMqConnectionString in the Application Settings.

[FunctionName("RabbitMqExample")]
[return: RabbitMQ(QueueName = "outputQueue", ConnectionStringSetting = "RabbitMqConnectionString")]
public static string Run(
    [RabbitMQTrigger(queueName: "inputQueue" ConnectionStringSetting = "RabbitMqConnectionString")] string name,
    ILogger logger)
{
    logger.LogInformation($"Message received: {name}.");
    return $"Hello, {name}.";
}

Along with string type, the extension also allows binding to the input arguments and returned values of byte[] type, POCO objects, and BasicDeliverEventArgs type. The last type is particularly useful for fetching of RabbitMQ message headers and other message properties. See the repository wiki for detailed samples of bindings to different types.

Getting Started

Before working with the RabbitMQ extension, you must set up your RabbitMQ endpoint. Then you can get started by following the sample functions in C#, C# Script, JavaScript, Python or Java.

To learn about creating an application that works with RabbitMQ, see the getting started page. For general documentation on .NET RabbitMQ client usage, see the .NET/C# client API guide.

Attributes

The following attributes are common to both RabbitMQ trigger and output bindings.

Attribute Name Type Description
ConnectionStringSetting string The setting name for RabbitMQ connection URI. An example setting value would be amqp://user:pass@host:10000/vhost.
QueueName string The RabbitMQ queue name.
DisableCertificateValidation boolean Indicates whether certificate validation should be disabled. Not recommended for production. Does not apply when SSL is disabled.

Further Reading

Please refer to the Microsoft Docs page on RabbitMQ bindings for Azure Functions overview. It contains install instructions for all the supported programming languages, information on setting up and configuring the function app, and the list of Azure App Service plans that support hosting of the function apps with RabbitMQ bindings.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azure-functions-rabbitmq-extension's People

Contributors

aaguilartablada avatar cachai2 avatar fabiocav avatar ggjason avatar jatinsanghvi avatar jeffhollan avatar katiecai avatar microsoftopensource avatar msftgits avatar pat-goins avatar pragnagopa avatar socolin avatar yojagad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.