Products Downloads


French version


 

This function is used to create a stream (JetStream).


Context

  • Windows client

  • Windows server

  • Java client

  • Java server

  • Adelia Web Client

  • Adelia Cloud client

  • Event Adelia client


Parameters

NUM_BIN_4

Handle

Connection ID

ALPHA

Stream

Stream name

ALPHA

Options

List of stream configuration options in the form of a list of key/value pairs separated by semi-colons.


Please see NATS documentation for a detailed explanation of the configuration options.


The accepted options are:

description
Stream description
retentionPolicy Retention policy (limits, interest, workqueue)
compressionOption Compression option (none, s2)
storageType Storage type (file, memory)
discardPolicy Discard policy (new, old)
maxConsumers Maximum number of associated consumers. Not entered by default (-1).
maxMsgs Maximum number of messages. Not entered by default (-1).
maxMsgsPerSubject Maximum number of messages per subject. Not entered by default (-1).
maxBytes Maximum stream size. Not entered by default (-1).
maxAge Maximum message lifespan in milliseconds. Not entered by default (0).
maxMsgSize Maximum message size. Not entered by default (-1).
replicas Number of stored replicas (from 1 to 5).
noAck Disabling of client acknowledgments, default false boolean.
duplicateWindow Duplicate verification window in milliseconds. Disabled by default (0).
subjects List of flow subjects separated by a comma.
placement Placement directive. List of values separated by commas, made up of a cluster name followed by a list of labels. Not entered by default.
republish

Republish configuration. List of key/value pairs separated by commas.

source Source subject
destination Destination subject
headersOnly Replicates headers only.


subjectTransform

Subject transformation list. List of key/value pairs separated by commas. The key is the source subject name and the value is the destination subject name.

consumerLimits

Subject transformation list in the form of a list of key/value pairs separated by commas.

inactiveThreshold Time after which the consumer is considered to be inactive (in milliseconds).
maxAckPending Maximum number of pending acknowledgments.


allowRollup Allows roll-up. Boolean, false by default.
allowDirect Allows direct access. Boolean, false by default.
mirrorDirect Allows direct access for mirrors. Boolean, false by default.
denyDelete Prevents message deletion. Boolean, false by default.
denyPurge Prevents messages being purged from the stream. Boolean, false by default.
discardNewPerSubject Defines if the "new" discardPolicy parameter applies to all subjects. By default, it applies only to new subjects. Boolean, false by default.
metaData Stream metadata. List of key/value pairs separated by commas.
firstSequence Sequence number of the first message. Positive integer, by default: 1.

ALPHA

Mirror

Description of a mirror source in the form of a list of key/value pairs separated by commas. This parameter cannot be specified at the same time as the Sources parameter.


The accepted options are:

name Source stream name
startSeq Start sequence number
startTime Start time
filterSubject Subject to filter
external

Definition of an external in the form of a list of key/value pairs separated by commas. This parameter cannot be specified at the same time as the domain parameter.

api API prefix
deliver Subject deliver


ALPHA[n]

Sources

Stream source definition table. The source description is identical to the Mirror parameter. This parameter cannot be specified at the same time as the Mirror parameter.

NUM_BIN_4

SourceLength

Length of a source array element

NUM_BIN_4

NumberSources

Number of elements to include in the Source array.

NUM_BIN_4

Rc

Function return code. The possible values are provided in NatsLastError function documentation. Output parameter.



Example

ALPHA(250) mirror
ALPHA(250) sources(2)
...

CALL_DLL 'NatsToolBx' 'NatsCreateStream' Handle 'ORDERS' 'description: Order stream; subjects: order.*' *BLANK sources 250 0 Rc

CALL_DLL 'NatsToolBx' 'NatsCreateStream' Handle 'RETURNS' 'description: Return stream; subjects: return.*' *BLANK sources 250 0 Rc
...

sources(1) = 'name:ORDERS'

sources(2) = 'name:RETURNS'
CALL_DLL 'NatsToolBx' 'NatsCreateStream' Handle 'ARCHIVES' 'description: Order archive' *BLANK sources 250 2 Rc
...

mirror = 'name:ARCHIVES'

CALL_DLL 'NatsToolBx' 'NatsCreateStream' Handle 'REPORT' 'description: Reporting' mirror sources 250 0 Rc

↑ Top of page


  • Aucune étiquette