Want to generate a unique number in a Sequence in API proxy

Not applicable

My target service requires a unique ID as a numeric parameter but in a sequence. Suggest me the most efficient way of making sequence in API proxy. I'm thinking of making a SQL conextion to obtain the sequence of an Database

thanks in advance

,

My target service requires a unique ID as a numeric parameter but in a sequence. Suggest me the most efficient way of making sequence in API proxy. I'm thinking of making a SQL conextion to obtain the sequence of an Database

0 5 732
5 REPLIES 5

Apigee Edge does not include a stateful store, and therefore cannot provide a persistent, monotonically increasing sequence ID. You have some options.

  • connect to a transactional database, and get a sequence ID from that
  • use a unique ID - a uuid or other random string generated from a PRNG

What do you need the sequence ID for ?

I need the secuence because the backend requires it.

If you don't require the sequence to be complete (ie: the backend can accept gaps in it), you could always convert the current timestamp to epoch time (# of milliseconds since 1/1/1970) via a javascript callout. That is an ever increasing sequence

Thanks, but the backend requires the number without gaps

I'm not sure if this is the best approach, but you can store your sequence number in Apigee BaaS. It is a no-sql database that Apigee offers.