A queue acts as a buffer that stores messages that are consumed later. A queue can also be declared with a number of attributes during creation. For instance, it can be marked as durable, auto-delete and exclusive, where exclusive means that it can be used by only one connection and this queue will be deleted when that connection closes.
A channel routes messages to a queue depending on the exchange type and bindings between the exchange and the queue. For a queue to receive messages, it must be bound to at least one exchange. AMQP 0.9.1 brokers should provide four exchange types - direct exchange, fanout exchange, topic exchange, and header exchange. An exchange can be declared with a number of attributes during creation. For instance, it can be marked as durable so that it survives a broker restart, or it can be marked as auto-delete meaning that it’s automatically deleted when the last queue is unbound.
A binding is a relation between a queue and an exchange consisting of a set of rules that the exchange uses (among other things) to route messages to queues.
A message is an entity sent from the publisher to the queue and finally subscribed to by the consumer. Each message contains a set of headers defining properties such as life duration, durability, and priority. AMQP 0.9.1 also has a built-in feature called message acknowledgment that is used to confirm message delivery and/or processing.
A channel is a virtual connection inside a connection, between two AMQP peers. Message publishing or consuming to or from a queue is performed over a channel (AMQP). A channel is multiplexed, one single connection can have multiple channels.
// Create websocket client and set server options
oClient := TsgcWebSocketClient.Create(nil);
oClient.Host := 'www.esegece.com';
oClient.Port := 5672;
// Create AMQP protocol and assign to websocket client
oAMQP := TsgcWSPClient_AMQP.Create(nil);
oAMQP.Client := oClient;
// AQMP Authentication
procedure OnAMQPAuthentication(Sender: TObject; aMechanisms: TsgcAMQPAuthentications; var Mechanism: TsgcAMQPAuthentication; var User, Password: string);
begin
User := 'sgc';
Password := 'sgc';
end;
// Handle AMQP methods
oAMQP.OnAMQPConnect := OnAMQPConnectHandler;
oAMQP.OnAMQPDisconnect := OnAMQPDisconnectHandler;
// connect to server
oClient.Active := True;
AMQP.Consume('channel_name', 'exchange_name', 'consumer_tag');
procedure OnAMQPBasicGetOk(Sender: TObject; const aChannel: string; const aGetOk: TsgcAMQPFramePayload_Method_BasicGetOk; const aContent: TsgcAMQPMessageContent);
begin
DoLog('#AMQP_basic_GetOk: ' + aChannel + ' ' + IntToStr(aGetOk.MessageCount) + ' ' + aContent.Body.AsString);
end;
AMQP.PublishMessage('channel_name', 'exchange_name', 'routing_key', 'Hello from sgcWebSockets!!!');
procedure OnAMQPBasicReturn(Sender: TObject; const aChannel: string; const aReturn: TsgcAMQPFramePayload_Method_BasicReturn; const aContent: TsgcAMQPMessageContent);
begin
DoLog('#AMQP_basic_return: ' + aChannel + ' ' + IntToStr(aReturn.ReplyCode) + ' ' + aReturn.ReplyText + ' ' + aContent.Body.AsString);
end;
AMQP.SetQoS('channel_name', 1024000, 100, false);
procedure OnAMQPBasicQoS(Sender: TObject; const aChannel: string; const aQoS: TsgcAMQPFramePayload_Method_BasicQoS);
begin
DoLog('#AMQP_basic_qos: ' + aChannel + ' ' + IntToStr(aQoS.PrefetchSize) + ' ' + IntToStr(aQoS.PrefetchCount) + ' ' + BoolToStr(aQoS.Global>;
end;
The component supports the following Platforms:
Native Delphi Components written in pure pascal. Share your code using our sgcWebSockets library for your Delphi projects. Includes Server, Clients and several protocols for building and connecting to applications.
Delphi
Real Time Monitor
Shows 3 gauges which are updated automatically every x seconds.
SGC Protocol (RPC, PubSub, Transactional Messages, Acknowledgement, QoS...)
Shows the use of subscriptions to a custom channel, transactions, Remote Procedure Calls, Acknowledgements...
Presence Protocol (PubSub, Publish Messages, Members subscribed...)
Allows to know who is subscribed to a channel, example: chat rooms, collaborators on a document, people viewing the same web page, competitors in a game...
DevExtreme Data Grid
This example shows how to use the DevExtreme Data Grid with a sgcWebSockets server and the Dataset protocol updating the stock quotes in real-time.
KendoUI Grid
Use KendoUI grid to create/edit/delete records and all changes will be broadcasted to all clients connected.
Real Time Quotes
Shows a grid where quotes are automatically updated in Real Time.
AppRTC (Audio And Video) using WebSockets
Broadcast audio and video between 2 clients using AppRTC code.
Multi-user Video Conference
Multi-user (many-to-many) video chat using mesh networking model.
Screen Sharing
Multi-user (one-to-many) screen sharing using star topology.
Video BroadCasting
Multi-user (one-to-many) video broadcasting using star topology.
Real Time Tickets
Create customer clients and all changes are broadcasted to all clients connected.
Chat
Simple chat to send/receive messages from others.
Binary Messages
Broadcast images to all clients connected.
WAMP Protocol (RPC and PubSub)
Show the use of WAMP protocol.
WebRTC (Audio and Video) via WebSockets
Broadcast audio and video between 2 clients.
Server-Sent Events
Shows the use of Server-Sent events.
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (Delphi 7 - Rad Studio 12)
Includes a set of compiled demos which shows the use of sgcWebSockets
Download
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (CBuilder 10.1 - CBuilder 12)
CBuilder 12 | CBuilder 11 | CBuilder 10_4 |
---|---|---|
CBuilder 10_3 | CBuilder 10_2 | CBuilder 10_1 |
Required Indy version for Delphi 7 in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Required Indy version for Lazarus in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Buy now your License to get sgcWebSockets source code: Delphi / CBuilder package includes full source code[1].
When you buy a license, you'll get access to full source code[1] and 1 Year of updates.
The license allows to install the package in all the machines you use/need but there are limits about the number of concurrent connections from different machines. This means that if you have for example a Single license, you can open the IDE multiple times in a single machine, but if you try to open the IDE in a second machine, it won't let you to work with it. If you need multiple licenses, you can purchase a Team or Site license with a discount.
We have an established discount program[1] for the following:
If you qualify or would like to inquire if you do, please Contact us for details.
Which support is included?
After you register your license, you get 1 year of updates and support by our online HelpDesk, public forums or by email.
How much time I need to wait between I purchase and I get the product?
Once registered, you get a link to download your package, so you don't need to wait, you'll get the package automatically after you purchase.
Where can I download updates of the library?
After successful registration, you get an user and password to login our website and you can download latest source version. When we release a new version, you'll get notified by mail.
Is there a Trial version of the sgcWebsockets?
Yes, you can download a trial version with precompiled units. This Trial is fully functional by limited in time. CBuilder packages require built-in Indy and Intraweb versions provided with Rad Studio (this limitation can be overriden if you've full source code).
Is Source Code available?
Yes, all sgcWebSockets Editions include full source code (except the BASIC edition).
How is your license scheme?
Is per-developer, so each developer that uses our product must have their own license.
Does the license expire?
No, the licenses are perpetual (with 6 or 12 months of free updates) and are royalty-free. Perpetual means that after expiration, you can use our components without limits, but this doesn't mean that you will get updates forever.
There are discounts if I renew a license?
Yes, if your subscription includes renewal discounts, a mail is sent automatically, when your license expires, with a discount code.
More info about checkout?
Yes, you can check following page with more info about checkout process.
Is support included?
Yes, support is included in any Edition. But if you are interested in faster response times and Enhanced support you can purchase Premium Support Plans with your package.
Native CBuilder Components written in pure Delphi code. Share your code using our sgcWebSockets library for your CBuilder projects. Includes Server, Clients and several protocols for building and connecting to applications.
CBuilder
Real Time Monitor
Shows 3 gauges which are updated automatically every x seconds.
SGC Protocol (RPC, PubSub, Transactional Messages, Acknowledgement, QoS...)
Shows the use of subscriptions to a custom channel, transactions, Remote Procedure Calls, Acknowledgements...
Presence Protocol (PubSub, Publish Messages, Members subscribed...)
Allows to know who is subscribed to a channel, example: chat rooms, collaborators on a document, people viewing the same web page, competitors in a game...
DevExtreme Data Grid
This example shows how to use the DevExtreme Data Grid with a sgcWebSockets server and the Dataset protocol updating the stock quotes in real-time.
KendoUI Grid
Use KendoUI grid to create/edit/delete records and all changes will be broadcasted to all clients connected.
Real Time Quotes
Shows a grid where quotes are automatically updated in Real Time.
AppRTC (Audio And Video) using WebSockets
Broadcast audio and video between 2 clients using AppRTC code.
Multi-user Video Conference
Multi-user (many-to-many) video chat using mesh networking model.
Screen Sharing
Multi-user (one-to-many) screen sharing using star topology.
Video BroadCasting
Multi-user (one-to-many) video broadcasting using star topology.
Real Time Tickets
Create customer clients and all changes are broadcasted to all clients connected.
Chat
Simple chat to send/receive messages from others.
Binary Messages
Broadcast images to all clients connected.
WAMP Protocol (RPC and PubSub)
Show the use of WAMP protocol.
WebRTC (Audio and Video) via WebSockets
Broadcast audio and video between 2 clients.
Server-Sent Events
Shows the use of Server-Sent events.
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (Delphi 7 - Rad Studio 12)
Includes a set of compiled demos which shows the use of sgcWebSockets
Download
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (CBuilder 10.1 - CBuilder 12)
CBuilder 12 | CBuilder 11 | CBuilder 10_4 |
---|---|---|
CBuilder 10_3 | CBuilder 10_2 | CBuilder 10_1 |
Required Indy version for Delphi 7 in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Required Indy version for Lazarus in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Buy now your License to get sgcWebSockets source code: Delphi / CBuilder package includes full source code[1].
When you buy a license, you'll get access to full source code[1] and 1 Year of updates.
The license allows to install the package in all the machines you use/need but there are limits about the number of concurrent connections from different machines. This means that if you have for example a Single license, you can open the IDE multiple times in a single machine, but if you try to open the IDE in a second machine, it won't let you to work with it. If you need multiple licenses, you can purchase a Team or Site license with a discount.
We have an established discount program[1] for the following:
If you qualify or would like to inquire if you do, please Contact us for details.
Which support is included?
After you register your license, you get 1 year of updates and support by our online HelpDesk, public forums or by email.
How much time I need to wait between I purchase and I get the product?
Once registered, you get a link to download your package, so you don't need to wait, you'll get the package automatically after you purchase.
Where can I download updates of the library?
After successful registration, you get an user and password to login our website and you can download latest source version. When we release a new version, you'll get notified by mail.
Is there a Trial version of the sgcWebsockets?
Yes, you can download a trial version with precompiled units. This Trial is fully functional by limited in time. CBuilder packages require built-in Indy and Intraweb versions provided with Rad Studio (this limitation can be overriden if you've full source code).
Is Source Code available?
Yes, all sgcWebSockets Editions include full source code (except the BASIC edition).
How is your license scheme?
Is per-developer, so each developer that uses our product must have their own license.
Does the license expire?
No, the licenses are perpetual (with 6 or 12 months of free updates) and are royalty-free. Perpetual means that after expiration, you can use our components without limits, but this doesn't mean that you will get updates forever.
There are discounts if I renew a license?
Yes, if your subscription includes renewal discounts, a mail is sent automatically, when your license expires, with a discount code.
More info about checkout?
Yes, you can check following page with more info about checkout process.
Is support included?
Yes, support is included in any Edition. But if you are interested in faster response times and Enhanced support you can purchase Premium Support Plans with your package.
Native Lazarus Components written in pure pascal. Share your code using our sgcWebSockets library for your Lazarus / Free Pascal projects. Includes Server, Clients and several protocols for building and connecting to applications.
Lazarus
Real Time Monitor
Shows 3 gauges which are updated automatically every x seconds.
SGC Protocol (RPC, PubSub, Transactional Messages, Acknowledgement, QoS...)
Shows the use of subscriptions to a custom channel, transactions, Remote Procedure Calls, Acknowledgements...
Presence Protocol (PubSub, Publish Messages, Members subscribed...)
Allows to know who is subscribed to a channel, example: chat rooms, collaborators on a document, people viewing the same web page, competitors in a game...
DevExtreme Data Grid
This example shows how to use the DevExtreme Data Grid with a sgcWebSockets server and the Dataset protocol updating the stock quotes in real-time.
KendoUI Grid
Use KendoUI grid to create/edit/delete records and all changes will be broadcasted to all clients connected.
Real Time Quotes
Shows a grid where quotes are automatically updated in Real Time.
AppRTC (Audio And Video) using WebSockets
Broadcast audio and video between 2 clients using AppRTC code.
Multi-user Video Conference
Multi-user (many-to-many) video chat using mesh networking model.
Screen Sharing
Multi-user (one-to-many) screen sharing using star topology.
Video BroadCasting
Multi-user (one-to-many) video broadcasting using star topology.
Real Time Tickets
Create customer clients and all changes are broadcasted to all clients connected.
Chat
Simple chat to send/receive messages from others.
Binary Messages
Broadcast images to all clients connected.
WAMP Protocol (RPC and PubSub)
Show the use of WAMP protocol.
WebRTC (Audio and Video) via WebSockets
Broadcast audio and video between 2 clients.
Server-Sent Events
Shows the use of Server-Sent events.
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (Delphi 7 - Rad Studio 12)
Includes a set of compiled demos which shows the use of sgcWebSockets
Download
Full Enterprise Single Trial version, works for a time limited period and can only be installed in a single WorkStation (CBuilder 10.1 - CBuilder 12)
CBuilder 12 | CBuilder 11 | CBuilder 10_4 |
---|---|---|
CBuilder 10_3 | CBuilder 10_2 | CBuilder 10_1 |
Required Indy version for Delphi 7 in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Required Indy version for Lazarus in order to install sgcWebSocket components (Standard and Professional Editions only).
Download
Buy now your License to get sgcWebSockets source code: Delphi / CBuilder package includes full source code[1].
When you buy a license, you'll get access to full source code[1] and 1 Year of updates.
The license allows to install the package in all the machines you use/need but there are limits about the number of concurrent connections from different machines. This means that if you have for example a Single license, you can open the IDE multiple times in a single machine, but if you try to open the IDE in a second machine, it won't let you to work with it. If you need multiple licenses, you can purchase a Team or Site license with a discount.
We have an established discount program[1] for the following:
If you qualify or would like to inquire if you do, please Contact us for details.
Which support is included?
After you register your license, you get 1 year of updates and support by our online HelpDesk, public forums or by email.
How much time I need to wait between I purchase and I get the product?
Once registered, you get a link to download your package, so you don't need to wait, you'll get the package automatically after you purchase.
Where can I download updates of the library?
After successful registration, you get an user and password to login our website and you can download latest source version. When we release a new version, you'll get notified by mail.
Is there a Trial version of the sgcWebsockets?
Yes, you can download a trial version with precompiled units. This Trial is fully functional by limited in time. CBuilder packages require built-in Indy and Intraweb versions provided with Rad Studio (this limitation can be overriden if you've full source code).
Is Source Code available?
Yes, all sgcWebSockets Editions include full source code (except the BASIC edition).
How is your license scheme?
Is per-developer, so each developer that uses our product must have their own license.
Does the license expire?
No, the licenses are perpetual (with 6 or 12 months of free updates) and are royalty-free. Perpetual means that after expiration, you can use our components without limits, but this doesn't mean that you will get updates forever.
There are discounts if I renew a license?
Yes, if your subscription includes renewal discounts, a mail is sent automatically, when your license expires, with a discount code.
More info about checkout?
Yes, you can check following page with more info about checkout process.
Is support included?
Yes, support is included in any Edition. But if you are interested in faster response times and Enhanced support you can purchase Premium Support Plans with your package.