---
name: "Mojo::RabbitMQ::Client::Method::Publish"
section: "3pm"
platform: "linux"
package: "libmojo-rabbitmq-client-perl"
version: "0.3.1-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Mojo::RabbitMQ::Client::Method::Publish"
---

# Mojo::RabbitMQ::Client::Method::Publish(3pm)

single class to do all of AMQP Publish method magic

## NAME

Mojo::RabbitMQ::Client::Method::Publish - single class to do all of AMQP Publish method magic

## SYNOPSIS

```
  use Mojo::RabbitMQ::Client::Method::Publish;
  my $method = Mojo::RabbitMQ::Client::Method::Publish->new(
    client => $client,
    channel => $channel
  )->setup(
    exchange    => 'mojo',
    routing_key => '',
    header      => {}
    body        => 'mojo',
    mandatory   => 0,
    immediate   => 0,
  )->deliver();
```

## DESCRIPTION

Mojo::RabbitMQ::Client::Method::Publish is a special class to implement AMQP message publish workflow.

## EVENTS

Mojo::RabbitMQ::Client::Method::Publish inherits all events from Mojo::RabbitMQ::Client::Method.

## ATTRIBUTES

Mojo::RabbitMQ:Client:::Method::Publish inherits all attributes from Mojo::RabbitMQ::Client::Method.

## METHODS

Mojo::RabbitMQ::Client::Method::Publish inherits all methods from Mojo::RabbitMQ::Client::Method with following changes.

### setup

```
  $method = $method->setup($arguments);
```

Only accepts common arguments for message publish chain. Which is:

- Frame::Method

  - Basic::Publish

    - •

      exchange

    - •

      routing\_key

    - •

      mandatory

    - •

      immediate

- Frame::Header

  - Basic::ContentHeader

    - •

      header

    - •

      weight

- Frame::Body

  - •

    body (as payload)

## SEE ALSO

Mojo::RabbitMQ::Client::Method, Mojo::RabbitMQ::Client::Channel, Mojo::RabbitMQ::Client

## COPYRIGHT AND LICENSE

Copyright (C) 2015-2017, Sebastian Podjasek and others

Based on AnyEvent::RabbitMQ - Copyright (C) 2010 Masahito Ikuta, maintained by `"bobtfish@bobtfish.net"`

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
