---
title: "Oneway Invocations"
url: https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations
language: java
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Oneway Invocations

Programming language: Java. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/csharp.md), [JavaScript](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode/oneway-invocations/swift.md).

A oneway invocation is an invocation made with a oneway proxy, a proxy whose [invocation mode](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode.md) is oneway. It sends the request without waiting for a reply, and completes as soon as the client's local transport accepts the request. For example, a client reports readings to a weather station:

```slice
struct AtmosphericConditions
{
    double temperature;
    double humidity;
    double pressure;
}

interface WeatherStation
{
    ["oneway"]
    void report(string sensorId, string timeStamp, AtmosphericConditions reading);
}
```

The [oneway](https://docs.zeroc.com/ice/3.8/slice/slice-metadata-directives/java.md#oneway) metadata directive is optional: it makes sure that clients invoke `report` only with a oneway, datagram, or batch proxy.

`ice_oneway` returns a oneway proxy, and an invocation on this proxy is a oneway invocation:

```java
WeatherStationPrx oneway = weatherStation.ice_oneway();
oneway.report(sensorId, timeStamp, reading);
```

A oneway invocation reports the errors that occur before the local transport accepts the request, such as a failure to establish a connection. It reports no error after this point, including when the connection fails or the dispatch fails.

The server dispatches a oneway request like any other request; `Current.requestId` is `0` for a oneway request.

If the server does not keep up with the client, the client's transport buffers fill up and a synchronous oneway invocation blocks until there is room. An asynchronous oneway invocation does not block.

On the server side, Ice reads the oneway requests received on a connection in the order the client sent them. A thread pool with several threads dispatches these requests concurrently, which loses this order. To dispatch the requests of a connection one at a time, in order, see [Serializing the Messages of Each Connection](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pools/java.md#serializing-the-messages-of-each-connection).
