danieleteti / delphistompclient Goto Github PK
View Code? Open in Web Editor NEWSTOMP client for Embarcadero Delphi and FreePascal.
STOMP client for Embarcadero Delphi and FreePascal.
What steps will reproduce the problem?
1. Unable to load library in Lazarus due to bad definition of QueryInterface
function QueryInterface(const IID: TGUID; out Obj)
to make the function cross compiler - you can use the following declaration.
function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
Attached are the files
Original issue reported on code.google.com by [email protected]
on 4 Aug 2014 at 6:17
Attachments:
We are using this project in our company, and in some case using as a gitsubmodule, in this cases we are creating a project file outside of the repository to avoid creating pending changes to commit.
What do you think about the idea of having a project to be built directly from the repository?
----- Edit:
I was looking at this now and saw the build.bat
and build.py
, could it be changed to generate Win32, Win64 and Linux64 files in the root directory? If you agree with this, I can make the change and send you a PR 😃
For connecting to a virtual host on RabbitMQ I miss a parameter for the virtual host name on method TStompClient.Connect.
For a test I have add a parameter host to the header in your code:
if STOMP_Version_1_1 in [FClientAcceptProtocolVersion] then
begin
Frame.GetHeaders.Add('heart-beat', '0,1000'); // stomp 1.1
Frame.GetHeaders.Add('accept-version', '1.1'); // stomp 1.1
Frame.GetHeaders.Add('host', virtualhost); // stomp 1.1
end;
With this modification I can send messages to the right virtual host on my RabbitMQ.
Is project compatible with Lazarus 3.2?
I use the delphi2007 run the chat demo,raise the error
"StompClient.pas(119):F1026 File not found:'Character.dcu',How can I get the
file?
Original issue reported on code.google.com by [email protected]
on 10 Oct 2012 at 7:33
Result is uninitialized.
I think Result.Id:=
should be changed to Result:=TKeyValue.Create(...)
it not support spring websocket server :)
What steps will reproduce the problem?
1. do a full build
What is the expected output? What do you see instead?
-> I want to see no errors, warnings, hints.
-> I get three W1035 warnings because the IUnknown methods of
TStompClientListener do not only never assign a retval, but completely lack
implementation
What version of the product are you using? On what operating system?
-> trunk/head with Delphi XE
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 20 Nov 2013 at 5:43
Hi @danieleteti,
When I try to authenticate with an invalid user, that server returns "Stopping tcp: //127.0.0.1:49367 because Failed with SecurityException: User name [guest] or password is invalid.", The InternalReceiveINDY statement if Result.Command = 'ERROR' then, the error "Access violation at address ..." is generated, because Result is nil due to the try except that exists in
class function StompUtils.CreateFrameWithBuffer (Buf: string): IStompFrame;
try
...
except
on EStomp do
begin
// ignore it
Result: = nil;
end;
on e: Exception of
begin
Result: = nil;
raise EStomp.Create (e.Message);
end;
end;
Since it is possible to identify the problem due to the exception below
could replace the code
if Result.Command = 'ERROR' then
raise EStomp.Create (FormatErrorFrame (Result));
per
if Assigned (Result) then
if Result.Command = 'ERROR' then
raise EStomp.Create (FormatErrorFrame (Result));
Thank you!
To simulate the problem, use the TCPView tool to close the connection once the StompClient is connected. To solve the problem I just added a try..except. Because de function fails, I can't use method Disconnect to force a new connection.
TCPView.zip
OBS: I'm not use Synapse
function TStompClient.Connected: boolean;
begin
try
{$IFDEF USESYNAPSE}
Result := Assigned(FSynapseTCP) and FSynapseConnected;
{$ELSE}
// ClosedGracefully <> FTCP.Connected !!!
Result := Assigned(FTCP) and FTCP.Connected and (not FTCP.IOHandler.ClosedGracefully);
{$ENDIF}
except
Result := False;
end;
end;
Following code does not compile in Delphi XE5:
function TStompFrame.OutputBytes: TBytes;
begin
Result := TEncoding.UTF8.GetBytes(FCommand + LINE_END + FHeaders.Output + LINE_END)
+ GetBytesBody + TEncoding.UTF8.GetBytes(COMMAND_END);
end;
Error:
[dcc32 Error] StompClient.pas(546): E2008 Incompatible types
Hi,
I'm using the StompClient to connect to an Oracle OpenMQ JMS. Every now and again (a few times a day) a message on an incoming queue appears to get stuck and does not arrive at the listening application - until it is "pushed through" by the subsequent message.
The problem is particularly visible with a heartbeat message that arrives once a minute. Every now and again there is a two minute delay between heartbeat messages instead of one - then two arrive at once. The sending application (a Java application on another computer under Linux) confirms that the messages were sent on time.
The receiving application, with the problem, is a Windows service running on a Windows Server 2012 R2 machine. It uses the StompClient compiled with the default options - i.e. the Indy socket. The application was compiled using Delphi XE5.
I have tried compiling it with the latest Delphi 10 Seattle, with no difference. I've also tried disabling the Nagle algorithm in the Indy socket (wasn't really expecting this to help in the client socket, and it didn't).
Recompiling the StompClient with the use Synapse conditional resolves the delay. However, with the Synapse socket, unicode characters do not get through.
There are several components in the overall system that could be responsible for the delay, however that fact that it goes away when recompiling with the Synapse socket pretty much identifies it as a problem with the Indy client socket.
The application has now been running for two weeks without any message delays, using Synapse. For the time being we're getting round this by using UTF-8, but it would be great to have this problem resolved with Indy sockets, or perhaps the native Delphi client socket, and to have a robust unicode StompClient.
I don't suppose this is really a problem with your StompClient, but I thought you should know about it as it affects its use.
Jon Stewart
How to reconnect after the connection loss? StompClient doesn't do this automatically.
Heartbeat is enabled, it throws "10057 Socket is not connected" when encounters a problem and changes Connected
to false, but nothing else happens. If I add this
if not lClient.Connected then lClient.Connect;
then there is a socket error 10054 Connection reset by peer (if network was down) or 10061 Connection Refused (if I killed connection using firewall's tool). Also tried lClient.Disconnect
before connecting and even lClient := lClient.Clone;
, same results.
does not compile on lazarus 2.2.0.
in delphi 10.4:
Stomp: Socket Error #10061
Connection refused.
TStompHeaders stores TKeyValue records in a TList by a pointer to a New'd
memory. The memory is free'd with FreeMem which actually deletes the
string references of the TKeyValue record, but not the strings. I verified
this problem with AQTime.
Original issue reported on code.google.com by [email protected]
on 14 Apr 2011 at 9:10
In function SendFrame , FSynapseTCP.SendBytes(AFrame.OutputBytes) .but SynpaseTCP no SendBytes function。 only SendByte.
I made an application in Delphi "Console Application" where I connect via PAServer to display on Linux Ubuntu.
However, when I run the program on the Linux terminal, but I need it on the PAServer screen, it displays a message like this:
EStomp: Socket Error # 111
Connection refused.
Sorry for the ignorance is the first time I'm working on this ...
Hi Daniel, I tried to compile GlobalDemo example, but I received a error message: Missing implementation of interface method IStompClientListener.OnMessage.
I search into StompTypes but apparently it isn't implemented.
Thanks
Please add list of supported Delphi versions into readme.md, so that it could be seen up front.
How to subscribe to a queue and receive messages only according to the desired header?
I tried FClient.Subscribe('/queue/' + edtQueue.Text, TAckMode.amClient, StompUtils.Headers.Add('type', 'x'));, but I keep receiving messages with other types of headers
Hello,
I have updade source for Stomp client :
a) Add NotifyEvent StompConnect
b) Support send text encoded (ASCII, ANSI, UTF8, delphi unicode
c) Support received text encoded
best regard,
Gérald CHENAVIER
Original issue reported on code.google.com by [email protected]
on 27 Jan 2011 at 4:40
Attachments:
StompTypes.TStompFrame.Output adds an extra LINE_END between the body and
the COMMAND_END. As long as you are just using this StompClient,
everything seems to be fine as this extra character is removed in
StompTypes.StompUtils.CreateFrame, but if you use a Java client or e.g.
the ActiveMQ WebInterface to send a message, the Delphi StompClient will
lose the last character of the message body.
Original issue reported on code.google.com by [email protected]
on 14 Apr 2011 at 9:10
In our implementation, we observe that when a message response comes back to the Delphi code via the stomp client, the response is not deleted from the response queue.
I have tried something like this to ack the message, thinking that ack-ing a message might remove it from the response queue.
procedure Consumer.OnMessage(StompClient: IStompClient; StompFrame: IStompFrame; var StopListening: Boolean);
<-- code deleted -->
StompClient.Ack(StompFrame.MessageID());
My question is:
Is this a correct way to ack a response? If not, could you please share how?
Thanks,
Arun
Hello,
Could you please let me know which is the open source license for this?
Thanks.
Hi I'm trying run tutorial examples at my Delphi XE and got a lot of errors during build the project something like that :
[DCC Error] StompClient.pas(357): E2010 Incompatible types: 'AnsiString' and 'string'
[DCC Error] StompClient.pas(360): E2003 Undeclared identifier: 'sslvTLSv1_2'
[DCC Error] StompClient.pas(756): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(763): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(820): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(825): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(828): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(833): E2029 $IFEND expected but $ENDIF found
[DCC Error] StompClient.pas(860): E2029 $IFEND expected but $ENDIF found
{$IF CompilerVersion < 24}
UTF8Encoding := TEncoding.UTF8;
{$ELSE}
UTF8Encoding := IndyTextEncoding_UTF8();
{$ENDIF} <---------------------- here must be {$IFEND}
Hi.
How to use the TMVCController class in DLL?
In DLL
`...
TAdminCntrl = class(TMVCController)
end;
function getController(const AMVC: TMVCEngine): TMVCControllerClass; stdcall;
exports
getController;
implementation
uses
SysUtils, MVCFramework.Session, System.JSON;
function getController(const AMVC: TMVCEngine): TMVCControllerClass; stdcall;
begin
MVC := AMVC;
Result := TAdminCntrl;
end;
...`
In AppServer
... APath := GetDirectoryName(APath); Res := System.SysUtils.FindFirst(APath + '*.dll', faAnyFile, SR); try while Res = 0 do begin dll := LoadLibrary(PWideChar(APath + SR.Name)); if dll <> 0 then begin get_func := GetProcAddress(dll, 'getController'); FMVC.AddController(get_func(FMVC)); end; Res := FindNext(SR); end; finally System.SysUtils.FindClose(SR); end; ...
When you call this controller's method, the error "Invalid class typecast".
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.