NATS C Client with JetStream and Streaming support  3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
status.h
Go to the documentation of this file.
1 // Copyright 2015-2022 The NATS Authors
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef STATUS_H_
15 #define STATUS_H_
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 
23 typedef enum
24 {
25 #if defined(NATS_CONN_STATUS_NO_PREFIX)
26  // This is deprecated and applications referencing connection
27  // status should be updated to use the values prefixed with NATS_CONN_STATUS_.
28 
29  DISCONNECTED = 0,
30  CONNECTING,
31  CONNECTED,
32  CLOSED,
33  RECONNECTING,
34  DRAINING_SUBS,
35  DRAINING_PUBS,
36 #else
44 #endif
45 
47 
49 typedef enum
50 {
51  NATS_OK = 0,
52 
59 
71 
76 
79 
87 
91 
94 
99 
101 
104 
106 
107  NATS_TIMEOUT,
109 
112 
115 
117 
121 
122  NATS_DRAINING,
124 
126 
128 
130 
132 
135 
136 } natsStatus;
137 
138 typedef enum {
139 
141  JSBadRequestErr = 10003,
173  JSNoAccountErr = 10035,
213  JSPeerRemapErr = 10075,
214  JSNotEnabledErr = 10076,
257  JSNoLimitsErr = 10120,
271 
272 } jsErrCode;
273 
274 #ifdef __cplusplus
275 }
276 #endif
277 
278 #endif /* STATUS_H_ */
jsErrCode
Definition: status.h:138
@ JSConsumerWQConsumerNotDeliverAllErr
Consumer must be deliver all on workqueue stream.
Definition: status.h:238
@ JSNoMessageFoundErr
No message found.
Definition: status.h:175
@ JSConsumerReplacementWithDifferentNameErr
Consumer replacement durable config not the same.
Definition: status.h:243
@ JSStreamInvalidConfig
Stream configuration validation error.
Definition: status.h:190
@ JSMirrorWithSubjectsErr
Stream mirrors can not also contain subjects.
Definition: status.h:172
@ JSReplicasCountCannotBeNegativeErr
Replicas count cannot be negative.
Definition: status.h:270
@ JSConsumerFilterNotSubsetErr
Consumer filter subject is not a valid subset of the interest subjects.
Definition: status.h:231
@ JSConsumerEphemeralWithDurableNameErr
Consumer expected to be ephemeral but a durable name was set in request.
Definition: status.h:158
@ JSConsumerDurableNameNotMatchSubjectErr
Consumer name in subject does not match durable name in request.
Definition: status.h:155
@ JSConsumerReplicasExceedsStreamErr
Consumer config replica count exceeds parent stream.
Definition: status.h:263
@ JSSequenceNotFoundErr
Sequence not found.
Definition: status.h:181
@ JSStreamTemplateCreateErr
Generic template creation failed.
Definition: status.h:204
@ JSStreamAssignmentErr
Generic stream assignment error.
Definition: status.h:186
@ JSAccountResourcesExceededErr
Resource limits exceeded for account.
Definition: status.h:140
@ JSConsumerMaxWaitingNegativeErr
Consumer max waiting needs to be positive.
Definition: status.h:225
@ JSConsumerStoreFailedErr
Error creating store for consumer.
Definition: status.h:241
@ JSConsumerPullWithRateLimitErr
Consumer in pull mode can not have rate limit set.
Definition: status.h:224
@ JSStorageResourcesExceededErr
Insufficient storage resources available.
Definition: status.h:185
@ JSConsumerCreateDurableAndNameMismatchErr
Consumer Durable and Name have to be equal if both are provided.
Definition: status.h:269
@ JSClusterNotLeaderErr
JetStream cluster can not handle request.
Definition: status.h:147
@ JSStreamPurgeFailedErr
Generic stream purge failure.
Definition: status.h:247
@ JSStreamTemplateNotFoundErr
Template not found.
Definition: status.h:206
@ JSStreamExternalApiOverlapErr
Stream external api prefix must not overlap.
Definition: status.h:159
@ JSConsumerNameTooLongErr
Consumer name is too long.
Definition: status.h:239
@ JSStreamSubjectOverlapErr
Subjects overlap with an existing stream.
Definition: status.h:203
@ JSConsumerPullNotDurableErr
Consumer in pull mode requires a durable name.
Definition: status.h:223
@ JSConsumerMaxPendingAckPolicyRequiredErr
Consumer requires ack policy for max ack pending.
Definition: status.h:220
@ JSClusterRequiredErr
JetStream clustering support required.
Definition: status.h:148
@ JSConsumerDeliverToWildcardsErr
Consumer deliver subject has wildcards.
Definition: status.h:217
@ JSStreamUpdateErr
Generic stream update error.
Definition: status.h:207
@ JSRestoreSubscribeFailedErr
JetStream unable to subscribe to restore snapshot.
Definition: status.h:180
@ JSConsumerConfigRequiredErr
Consumer config required.
Definition: status.h:216
@ JSClusterNotAvailErr
JetStream system temporarily unavailable.
Definition: status.h:146
@ JSPeerRemapErr
Peer remap failed.
Definition: status.h:213
@ JSConsumerEphemeralWithDurableInSubjectErr
Consumer expected to be ephemeral but detected a durable name set in subject.
Definition: status.h:157
@ JSStreamLimitsErr
General stream limits exceeded error.
Definition: status.h:191
@ JSConsumerNameExistErr
Consumer name already in use.
Definition: status.h:151
@ JSInvalidJSONErr
Invalid JSON.
Definition: status.h:163
@ JSStreamTemplateDeleteErr
Generic stream template deletion failed error.
Definition: status.h:205
@ JSStreamMessageExceedsMaximumErr
Message size exceeds maximum allowed.
Definition: status.h:192
@ JSStreamMirrorNotUpdatableErr
Mirror configuration can not be updated.
Definition: status.h:193
@ JSConsumerFCRequiresPushErr
Consumer flow control requires a push based consumer.
Definition: status.h:227
@ JSStreamMoveAndScaleErr
Cannot move and scale a stream in a single update.
Definition: status.h:260
@ JSStreamReplicasNotUpdatableErr
Replicas configuration can not be updated.
Definition: status.h:199
@ JSConsumerMaxRequestBatchExceededErr
Consumer max request batch exceeds server limit.
Definition: status.h:262
@ JSConsumerWQConsumerNotUniqueErr
Filtered consumer not unique on workqueue stream.
Definition: status.h:237
@ JSMirrorWithStartSeqAndTimeErr
Stream mirrors can not have both start seq and start time configured.
Definition: status.h:170
@ JSStreamMaxStreamBytesExceededErr
Stream max bytes exceeds account limit max stream bytes.
Definition: status.h:259
@ JSConsumerDirectRequiresEphemeralErr
Consumer direct requires an ephemeral consumer.
Definition: status.h:229
@ JSStreamMaxBytesRequiredErr
Account requires a stream config to have max bytes set.
Definition: status.h:250
@ JSStreamSequenceNotMatchErr
Expected stream sequence does not match.
Definition: status.h:201
@ JSClusterTagsErr
Tags placement not supported for operation.
Definition: status.h:149
@ JSStreamNotFoundErr
Stream not found.
Definition: status.h:197
@ JSStreamNameContainsPathSeparatorsErr
Stream name can not contain path separators.
Definition: status.h:265
@ JSStreamNotMatchErr
Expected stream does not match.
Definition: status.h:198
@ JSConsumerOnMappedErr
Consumer direct on a mapped consumer.
Definition: status.h:230
@ JSConsumerHBRequiresPushErr
Consumer idle heartbeat requires a push based consumer.
Definition: status.h:226
@ JSMaximumStreamsLimitErr
Maximum number of streams reached.
Definition: status.h:165
@ JSConsumerWQRequiresExplicitAckErr
Workqueue stream requires explicit ack.
Definition: status.h:235
@ JSStreamInvalidExternalDeliverySubjErr
Stream external delivery prefix must not contain wildcards.
Definition: status.h:162
@ JSConsumerWQMultipleUnfilteredErr
Multiple non-filtered consumers not allowed on workqueue stream.
Definition: status.h:236
@ JSStreamInfoMaxSubjectsErr
Subject details would exceed maximum allowed.
Definition: status.h:254
@ JSStreamOfflineErr
Stream is offline.
Definition: status.h:255
@ JSConsumerInvalidPolicyErr
Generic delivery policy error.
Definition: status.h:232
@ JSStreamMismatchErr
Stream name in subject does not match request.
Definition: status.h:194
@ JSClusterUnSupportFeatureErr
Not currently supported in clustered mode.
Definition: status.h:174
@ JSStreamDeleteErr
General stream deletion error.
Definition: status.h:188
@ JSConsumerExistingActiveErr
Consumer already exists and is still active.
Definition: status.h:242
@ JSStreamCreateErr
Generic stream creation error.
Definition: status.h:187
@ JSStreamReplicasNotSupportedErr
Replicas > 1 not supported in non-clustered mode.
Definition: status.h:212
@ JSMirrorMaxMessageSizeTooBigErr
Stream mirror must have max message size >= source.
Definition: status.h:168
@ JSConsumerPushMaxWaitingErr
Consumer in push mode can not set max waiting.
Definition: status.h:218
@ JSNoAccountErr
Account not found.
Definition: status.h:173
@ JSConsumerSmallHeartbeatErr
Consumer idle heartbeat needs to be >= 100ms.
Definition: status.h:221
@ JSMirrorConsumerSetupFailedErr
Generic mirror consumer setup failure.
Definition: status.h:167
@ JSConsumerDirectRequiresPushErr
Consumer direct requires a push based consumer.
Definition: status.h:228
@ JSStreamNameExistRestoreFailedErr
Stream name already in use, cannot restore.
Definition: status.h:267
@ JSClusterNotAssignedErr
JetStream cluster not assigned to this server.
Definition: status.h:145
@ JSStreamSealedErr
Invalid operation on sealed stream.
Definition: status.h:246
@ JSConsumerMaxRequestExpiresToSmallErr
Consumer max request expires needs to be > 1ms.
Definition: status.h:252
@ JSConsumerDurableNameNotSetErr
Consumer expected to be durable but a durable name was not set.
Definition: status.h:156
@ JSConsumerNotFoundErr
Consumer not found.
Definition: status.h:152
@ JSRaftGeneralErr
General RAFT error.
Definition: status.h:179
@ JSConsumerBadDurableNameErr
Durable name can not contain '.', '*', '>'.
Definition: status.h:240
@ JSConsumerOfflineErr
Consumer is offline.
Definition: status.h:256
@ JSConsumerInvalidDeliverSubjectErr
Invalid push consumer deliver subject.
Definition: status.h:249
@ JSMaximumConsumersLimitErr
Maximum consumers exceeds account limit.
Definition: status.h:164
@ JSNotEnabledForAccountErr
JetStream not enabled for account.
Definition: status.h:177
@ JSStreamWrongLastSequenceErr
Wrong last sequence.
Definition: status.h:209
@ JSMirrorWithSourcesErr
Stream mirrors can not also contain other sources.
Definition: status.h:169
@ JSConsumerNameContainsPathSeparatorsErr
Consumer name can not contain path separators.
Definition: status.h:264
@ JSConsumerCreateFilterSubjectMismatchErr
Consumer create request did not match filtered subject from create subject.
Definition: status.h:268
@ JSClusterServerNotMemberErr
Server is not a member of the cluster.
Definition: status.h:182
@ JSConsumerInvalidSamplingErr
Failed to parse consumer sampling configuration.
Definition: status.h:233
@ JSConsumerDescriptionTooLongErr
Consumer description is too long.
Definition: status.h:244
@ JSNotEmptyRequestErr
Expected an empty request payload.
Definition: status.h:176
@ JSStreamMsgDeleteFailed
Generic message deletion failure error.
Definition: status.h:195
@ JSStreamRestoreErr
Restore failed.
Definition: status.h:200
@ JSStreamStoreFailedErr
Generic error when storing a message failed.
Definition: status.h:215
@ JSTemplateNameNotMatchSubjectErr
Template name in subject does not match request.
Definition: status.h:211
@ JSConsumerWithFlowControlNeedsHeartbeatsErr
Consumer with flow control also needs heartbeats.
Definition: status.h:245
@ JSStreamGeneralError
General stream failure.
Definition: status.h:189
@ JSConsumerMaxRequestBatchNegativeErr
Consumer max request batch needs to be > 0.
Definition: status.h:251
@ JSConsumerPullRequiresAckErr
Consumer in pull mode requires explicit ack policy.
Definition: status.h:222
@ JSStreamMoveNotInProgressErr
Stream move not in progress.
Definition: status.h:266
@ JSStreamMoveInProgressErr
Stream move already in progress.
Definition: status.h:261
@ JSStreamSnapshotErr
Snapshot failed.
Definition: status.h:202
@ JSConsumerMaxPendingAckExcessErr
Consumer max ack pending exceeds system limit.
Definition: status.h:258
@ JSSourceMaxMessageSizeTooBigErr
Stream source must have max message size >= target.
Definition: status.h:184
@ JSBadRequestErr
Bad request.
Definition: status.h:141
@ JSNoLimitsErr
No JetStream default or applicable tiered limit present.
Definition: status.h:257
@ JSTempStorageFailedErr
JetStream unable to open temp storage for restore.
Definition: status.h:210
@ JSInsufficientResourcesErr
Insufficient resources.
Definition: status.h:161
@ JSStreamWrongLastMsgIDErr
Wrong last msg ID.
Definition: status.h:208
@ JSMemoryResourcesExceededErr
Insufficient memory resources available.
Definition: status.h:166
@ JSSnapshotDeliverSubjectInvalidErr
Deliver subject not valid.
Definition: status.h:153
@ JSClusterPeerNotMemberErr
Peer not a member.
Definition: status.h:178
@ JSClusterNoPeersErr
No suitable peers for placement.
Definition: status.h:143
@ JSStreamExternalDelPrefixOverlapsErr
Stream external delivery prefix overlaps with stream subject.
Definition: status.h:160
@ JSClusterIncompleteErr
Incomplete results.
Definition: status.h:142
@ JSSourceConsumerSetupFailedErr
General source consumer setup failure.
Definition: status.h:183
@ JSStreamInvalidErr
Stream not valid.
Definition: status.h:234
@ JSClusterNotActiveErr
JetStream not in clustered mode.
Definition: status.h:144
@ JSStreamNameExistErr
Stream name already in use.
Definition: status.h:196
@ JSConsumerMaxDeliverBackoffErr
Max deliver is required to be > length of backoff values.
Definition: status.h:253
@ JSConsumerCreateErr
General consumer creation failure string.
Definition: status.h:150
@ JSConsumerDeliverCycleErr
Consumer deliver subject forms a cycle.
Definition: status.h:219
@ JSMirrorWithSubjectFiltersErr
Stream mirrors can not contain filtered subjects.
Definition: status.h:171
@ JSNotEnabledErr
JetStream not enabled.
Definition: status.h:214
@ JSConsumerDurableNameNotInSubjectErr
Consumer expected to be durable but no durable name set in subject.
Definition: status.h:154
@ JSStreamRollupFailedErr
Generic stream rollup failure.
Definition: status.h:248
natsStatus
Status returned by most of the APIs.
Definition: status.h:50
@ NATS_DRAINING
Definition: status.h:122
@ NATS_SECURE_CONNECTION_WANTED
Definition: status.h:66
@ NATS_PROTOCOL_ERROR
Definition: status.h:54
@ NATS_MISMATCH
For JetStream subscriptions, it means that a consumer sequence mismatch was discovered.
Definition: status.h:129
@ NATS_INVALID_SUBSCRIPTION
Definition: status.h:84
@ NATS_INSUFFICIENT_BUFFER
A buffer is not large enough to accommodate the data.
Definition: status.h:100
@ NATS_MISSED_HEARTBEAT
For JetStream subscriptions, it means that the library detected that server heartbeats have been miss...
Definition: status.h:131
@ NATS_ERR
Generic error.
Definition: status.h:53
@ NATS_IO_ERROR
IO Error (network communication).
Definition: status.h:56
@ NATS_NO_SERVER
Definition: status.h:62
@ NATS_CONNECTION_AUTH_FAILED
The connection failed due to authentication error.
Definition: status.h:72
@ NATS_CONNECTION_CLOSED
Definition: status.h:60
@ NATS_NOT_YET_CONNECTED
Definition: status.h:118
@ NATS_NO_MEMORY
Definition: status.h:102
@ NATS_INVALID_ARG
Definition: status.h:81
@ NATS_INVALID_SUBJECT
Invalid subject, for instance NULL or empty string.
Definition: status.h:80
@ NATS_FAILED_TO_INITIALIZE
The library failed to initialize.
Definition: status.h:110
@ NATS_INVALID_TIMEOUT
Timeout must be positive numbers.
Definition: status.h:86
@ NATS_LINE_TOO_LONG
Definition: status.h:57
@ NATS_SSL_ERROR
Definition: status.h:113
@ NATS_INVALID_QUEUE_NAME
An invalid queue name was passed when creating a queue subscription.
Definition: status.h:125
@ NATS_NO_SERVER_SUPPORT
The server does not support this action.
Definition: status.h:116
@ NATS_SYS_ERROR
Some system function returned an error.
Definition: status.h:105
@ NATS_MAX_DELIVERED_MSGS
Definition: status.h:97
@ NATS_ILLEGAL_STATE
Definition: status.h:88
@ NATS_OK
Success.
Definition: status.h:51
@ NATS_STALE_CONNECTION
Definition: status.h:64
@ NATS_NO_RESPONDERS
No responders were running when the server received the request.
Definition: status.h:127
@ NATS_TIMEOUT
Definition: status.h:107
@ NATS_SECURE_CONNECTION_REQUIRED
The server expects a TLS connection.
Definition: status.h:68
@ NATS_CONNECTION_DISCONNECTED
Definition: status.h:69
@ NATS_LIMIT_REACHED
Definition: status.h:133
@ NATS_NOT_PERMITTED
The action is not permitted.
Definition: status.h:73
@ NATS_NOT_FOUND
Definition: status.h:74
@ NATS_ADDRESS_MISSING
Definition: status.h:77
@ NATS_NOT_INITIALIZED
The library is not yet initialized.
Definition: status.h:111
@ NATS_SLOW_CONSUMER
Definition: status.h:92
@ NATS_MAX_PAYLOAD
Definition: status.h:95
natsConnStatus
The connection state.
Definition: status.h:24
@ NATS_CONN_STATUS_DISCONNECTED
The connection has been disconnected.
Definition: status.h:37
@ NATS_CONN_STATUS_CONNECTED
The connection is connected.
Definition: status.h:39
@ NATS_CONN_STATUS_CONNECTING
The connection is in the process or connecting.
Definition: status.h:38
@ NATS_CONN_STATUS_CLOSED
The connection is closed.
Definition: status.h:40
@ NATS_CONN_STATUS_DRAINING_SUBS
The connection is draining subscriptions.
Definition: status.h:42
@ NATS_CONN_STATUS_DRAINING_PUBS
The connection is draining publishers.
Definition: status.h:43
@ NATS_CONN_STATUS_RECONNECTING
The connection is in the process or reconnecting.
Definition: status.h:41