LogoLogo
  • 60East Frequently Asked Questions
  • Release and Hotfix Policies
    • What is a "Preview" version of the AMPS Server?
    • What is the 60East Hotfix Policy?
  • Getting Support
    • What's in a minidump file? Does it include the data that's in AMPS?
    • How do I use WinSCP to upload files to the 60East SFTP support server?
    • Can everyone see things I put in support tickets?
    • How can I split large log files to upload them?
    • Is replication between different versions of AMPS supported?
  • AMPS Features and Capabilities
    • General Topics
      • What software/hardware is required to run AMPS?
      • Content filtering sounds cool, how does it work?
      • Is AMPS a point-to-point messaging product?
      • What database does AMPS use?
      • Can I publish and subscribe at the same time?
      • What CRC32 implementation does AMPS use?
      • How does AMPS support UTF-8 and Unicode?
    • Setting up Instances
      • AMPS on Apple Silicon: Running a Development Instance
      • Can I run AMPS on Windows?
      • How do I run AMPS in a container?
      • How can I have AMPS ignore SIGHUP?
    • State-of-the-World
      • What is the difference between a Topic in the SOW and the Transaction Log?
      • How does a messaging product support queries?
      • How do I subscribe to a view or an aggregate in my program?
      • How can I paginate a SOW query?
      • What happens if data changes while a SOW query is running?
      • Does AMPS return messages from the SOW in the order published?
      • How many columns/fields can I have in a SOW topic? In a view?
      • What is "Focus" in AMPS?
      • What are some ways to consume large SOW queries?
      • Do I need to list every field in a SOW topic configuration?
      • How can I get the number of records in a SOW topic?
      • How can I delete messages from a SOW topic?
      • Should I use the SOW delete action or message expiration to maintain my SOW topic?
      • How do I configure SOW storage parameters?
      • How do I get only the first 100 records from a SOW query?
      • What is the difference between historical SOW and bookmark replay?
      • Do I have to add configuration for every topic I want to publish to?
      • How does AMPS construct the SowKey for a message?
      • What happens if I change the key of a SOW topic?
    • Message Formats and Content Filtering
      • Why should I use AMPS content filtering?
      • What is the default message type for AMPS?
      • Does AMPS validate messages?
      • How does AMPS handle invalid FIX/NVFIX?
      • Can AMPS filters do case-insensitive comparisons?
      • Can I just send uninterpreted binary messages with AMPS?
      • What's BFlat?
    • Incremental Update and Change Set Delivery
      • Do I have to use delta publish to have a delta subscription?
    • Replication and High Availability
      • Does AMPS support replication?
      • Why does publishFlush() wait forever when I'm using replication?
      • Are SOW topics that are replicated guaranteed to be in sync on all instances?
      • How do I set up a failover group in my replication destination
      • How does AMPS report the specific failure in replication validation?
    • Messaging Paradigms
      • How can I do ad hoc message routing in AMPS?
      • What is a bookmark subscription?
    • Aggregation and Analytics
      • What is a View and how can it be used for aggregation?
    • Performance Questions
      • How fast is AMPS?
      • Which is faster, a regular subscription or a bookmark subscription that uses the "live" option?
  • Application Development with AMPS Clients
    • Unique Client Naming and AMPS
    • Which version of the client do I need for a specific version of AMPS?
    • How does an application pass credentials to AMPS?
    • What are the entries in a bookmark store file?
    • Is there a way to use AMPS itself as a bookmark store?
    • Should I use TCP_NODELAY for connections to AMPS?
    • Should I use Command or Message to send commands to AMPS?
    • How do I set the CorrelationId when I publish a message?
    • Why does publishFlush() wait forever when I'm using replication?
    • Can I send commands to AMPS from inside a message handler?
    • How do I use a custom Authenticator with HAClient?
    • What's the difference between CommandId, QueryId, and SubId?
    • Do I need to use an HAClient?
    • What character set is supported for CorrelationID?
    • Can I add a correlation token to the header of a message?
    • How do I change the filter on a subscription?
    • Can a client have more than one subscription at a time?
    • Can a subscriber tell who published a message?
    • Why do messages sometimes have strange data when I'm using asynchronous processing?
    • What character encoding is being used by the AMPS clients?
    • Why does my HAClient appear to hang when my server is down or the URI is incorrect?
    • How can I reconnect to my AMPS server when a disconnect occurs?
    • How can I use AMPS with a XAML application?
    • Can I enforce unique client naming without creating a transaction log file?
    • How can I tell if my program is not entitled to publish to a topic?
    • When using the Python client, will the background thread exit when the program exits?
    • Do I need more than one AMPS client object in my program?
    • Why does AMPS disconnect a client with a 'name in use' error?
    • In bookmark subscribes, why does EPOCH give me the same messages as MOST_RECENT?
  • Operations and Deployment
    • How can I manage complicated configuration files?
    • How can I find the version of my AMPS server?
    • Can I run multiple instances of AMPS on the same system?
    • What's in a minidump file? Does it include the data that's in AMPS?
    • What Does it Mean when dmesg Says AMPS Blocked for More than 120 Seconds
    • What is the 60East Hotfix Policy?
    • What software/hardware is required to run AMPS?
    • What does seconds_behind mean?
    • How do I run AMPS in a Docker container?
    • How do I use custom authentication with spark?
    • What is client reaping?
    • Is replication between different versions of AMPS supported?
    • How much bandwidth will replication require?
    • What value is normal for a specific performance counter?
    • Why is AMPS logging a memory allocation failure when the system has plenty of free memory?
    • Can I check a configuration file without restarting AMPS?
    • What's the difference between sync and async acknowledgement in AMPS replication?
    • Do I need to worry when a regular expression topic name can't be validated?
    • Can AMPS run as a User Service?
    • Can I dynamically choose which topics to replicate?
    • Should we have Hyper-threading enabled on AMPS servers?
    • Does AMPS correctly handle leap seconds?
    • How do I copy a SOW from one AMPS instance to another?
    • How can I control the size of the statistics database?
    • How can I configure AMPS to use a specific network adapter?
    • How can I limit the amount of memory AMPS consumes?
    • What if I need to move messages from one AMPS instance to another?
    • Is PCIe SSD a requirement when using a transaction log?
    • AMPS Log Messages
      • How do I get more information on an AMPS error?
      • How can I tell where a connection is coming from?
      • Does AMPS log current process limits?
      • What does it mean when AMPS has detected that it may not be running correctly?
      • How can I keep only the last week of error logs?
      • What is the difference between "execution time" and "elapsed time" in the logs?
      • What does a "potential stuck thread" message mean?
      • What does a "message cache is throttled" warning mean?
      • What does "Replication has detected an existing connection" mean? Why does AMPS close the connection?
      • Where is the list of all the event and error messages in AMPS?
      • What can cause an "unknown command received" or "parse format error"?
      • Why does AMPS disconnect a client with a 'name in use' error?
      • How do I exclude passwords in trace logging?
Powered by GitBook
On this page
  1. Application Development with AMPS Clients

Unique Client Naming and AMPS

In the AMPS client APIs, each instance of the AMPS client is required to provide a client name. The AMPS server treats the client name as a distinct token for a specific instance of an application.

What that means in practical terms is that:

  • Only one client with the same name should be connected at a given time

  • Different instances of the application should use different names

  • The same instance of the application should use the same name

Although these are always good practices, AMPS only enforces unique client naming when there is a transaction log configured for the instance.

Logon and Client Name

AMPS sets the client name for the connection when the client logs on, not when the client connects. This prevents a client that does not have permission to log on from setting a client name that might be in use by another application.

AMPS may be configured to allow implicit logon. In implicit logon, the client name is set on the first command, and the client name uses the name of the connection (such as amps-json-tcp-23). Starting in 5.0.0.0, AMPS does not allow implicit logon by default, since this approach to assigning names will cause AMPS to assign duplicate names across instance restarts and the same application instance will have different names when it reconnects to AMPS. (See the User Guide for information on enabling implicit logon.)

Transaction Logging, Durable Messaging and Unique Names

When a transaction log is configured, AMPS only allows one application with a given client name and the same authenticated ID to connect at a time.

Unique client naming is particularly important when a transaction log is configured. There are two reasons for this:

First, because the application has identified itself as being the same instance as another running instance, AMPS assumes that the same instance of the application is reconnecting before the operating system has notified the server that the previous instance disconnected. To minimize application downtime and use server resources efficiently, AMPS disconnects the previous instance.

The AMPS client declares the uniqueness of messages published to the AMPS server by including a monotonically increasing sequence number on each message published. The client controls the number, and AMPS keeps track of the highest number that AMPS has persisted for a given client. If more than one instance of the client were to use the same name, there would be no way for AMPS to tell the sequence numbers apart.

Last, but not least, the AMPS client libraries use the client name, in conjunction with the AMPS server, as a part of the message durability and recovery strategy. For durable publish and durable subscriptions that will survive an application restart, it's important for the client name to be both unique and consistent across restarts.

Choosing a Naming Strategy

In choosing a naming strategy, consider what makes an application instance unique and use this as the basis for your naming. Also consider making the name easy to correlate to the application instance. At the same time, consider that the longer the name is, the more space will be consumed for AMPS error logs. A good approach is to look for the shortest name that is unique, easy to correlate, and easily readable. While AMPS does not enforce specific restrictions on the character set for a client name, 60East recommends avoiding non-printing characters, newlines, and square brackets ([]) to make it easier to process AMPS logs.

Suppose we have an application for entering orders by a given agent. Each agent has a unique view of the application, and each agent has a distinct instance of the application. At the same time, even if a particular agent shuts down the application and restarts their computer, when they start the application again, it's not a new instance -- they're resuming the same instance of the application. In this case, a unique name might combine the name of the application, the agent name, and the name of the computer running the application. So, for example, a good client name for this application might take a format like Orders-AndyP-TradeDesk45.

By contrast, suppose we have an application that runs an elastic grid of workers that run on virtual machines that are started on demand and shut down when there is no more work to do. Each of these workers is stateless, and is created from an identical operating system image. In this case, it's important for each worker to have a completely unique name. A good client name for this application might use a descriptive name for the application combined with a unique token such as the IP address of the worker. A good client name for this application might take a format such as CrunchData-192.168.0.20.

Last updated 1 year ago