---
name: "zmq_msg_set_routing_id"
section: "3"
platform: "linux"
package: "zeromq"
version: "4.3.5-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/zmq_msg_set_routing_id"
---

# zmq\_msg\_set\_routing\_id(3)

set routing ID property on message

## NAME

zmq\_msg\_set\_routing\_id - set routing ID property on message

## SYNOPSIS

**int zmq\_msg\_set\_routing\_id (zmq\_msg\_t** *\*message***, uint32\_t** *routing\_id***);**

## DESCRIPTION

The *zmq\_msg\_set\_routing\_id()* function sets the *routing\_id* specified, on the the message pointed to by the *message* argument. The *routing\_id* must be greater than zero. To get a valid routing ID, you must receive a message from a *ZMQ\_SERVER* socket, and use the libzmq:zmq\_msg\_routing\_id method. Routing IDs are transient.

## RETURN VALUE

The *zmq\_msg\_set\_routing\_id()* function shall return zero if successful. Otherwise it shall return -1 and set *errno* to one of the values defined below.

## ERRORS

**EINVAL**

The provided *routing\_id* is zero.

## SEE ALSO

[**zmq\_msg\_routing\_id**(3)](/zmq_msg_routing_id/3.md) [**zmq**(7)](/zmq/7.md)

## AUTHORS

This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at **http://www.zeromq.org/docs:contributing**.
