1
1
/*
2
- * Licensed to the Apache Software Foundation (ASF) under one or more
3
- * contributor license agreements. See the NOTICE file distributed with
4
- * this work for additional information regarding copyright ownership.
5
- * The ASF licenses this file to You under the Apache License, Version 2.0
6
- * (the "License"); you may not use this file except in compliance with
7
- * the License. You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
17
18
18
#include <stdio.h>
19
- #include "CProducer.h"
20
19
#include "CCommon.h"
21
20
#include "CMessage.h"
21
+ #include "CProducer.h"
22
22
#include "CSendResult.h"
23
23
#ifdef _WIN32
24
24
#include <windows.h>
25
25
#else
26
- #include <unistd.h>
27
26
#include <memory.h>
27
+ #include <unistd.h>
28
28
#endif
29
29
30
30
void thread_sleep (unsigned int milliseconds ) {
@@ -47,10 +47,10 @@ void StartSendMessage(CProducer* producer) {
47
47
snprintf (body , sizeof (body ), "new message body, index %d" , i );
48
48
SetMessageBody (msg , body );
49
49
int status = SendMessageSync (producer , msg , & result );
50
- if (status == OK ){
50
+ if (status == OK ) {
51
51
printf ("send message[%d] result status:%d, msgId:%s\n" , i , (int )result .sendStatus , result .msgId );
52
- }else {
53
- printf ("send message[%d] failed !\n" ,i );
52
+ } else {
53
+ printf ("send message[%d] failed !\n" , i );
54
54
}
55
55
thread_sleep (1000 );
56
56
}
0 commit comments