Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
f08ea241
Commit
f08ea241
authored
Dec 24, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
d87d8b7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
UserEventCollectingUtil.java
...xyqb/risk/uereventcollecting/UserEventCollectingUtil.java
+3
-9
No files found.
src/main/java/cn/quantgroup/xyqb/risk/uereventcollecting/UserEventCollectingUtil.java
View file @
f08ea241
...
@@ -22,13 +22,13 @@ import java.io.UnsupportedEncodingException;
...
@@ -22,13 +22,13 @@ import java.io.UnsupportedEncodingException;
@Slf4j
@Slf4j
public
class
UserEventCollectingUtil
{
public
class
UserEventCollectingUtil
{
private
static
final
MyCallBack
<
UserRecordResult
>
CALL_BACK
=
new
MyCallBack
<>();
public
static
void
addEvent
(
EventInfo
eventInfo
)
{
public
static
void
addEvent
(
EventInfo
eventInfo
)
{
KinesisProducerClient
client
=
KinesisProducerClientFactory
.
getClient
();
KinesisProducerClient
client
=
KinesisProducerClientFactory
.
getClient
();
try
{
try
{
MyCallBack
<
UserRecordResult
>
CallBack
=
new
MyCallBack
<>(
eventInfo
);
ListenableFuture
<
UserRecordResult
>
future
=
client
.
SendRecord
(
eventInfo
);
ListenableFuture
<
UserRecordResult
>
future
=
client
.
SendRecord
(
eventInfo
);
Futures
.
addCallback
(
future
,
C
allBack
);
Futures
.
addCallback
(
future
,
C
ALL_BACK
);
}
catch
(
UnsupportedEncodingException
e
)
{
}
catch
(
UnsupportedEncodingException
e
)
{
log
.
error
(
"发送事件异常UnsupportedEncodingException:{}"
,
e
);
log
.
error
(
"发送事件异常UnsupportedEncodingException:{}"
,
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -39,15 +39,9 @@ public class UserEventCollectingUtil {
...
@@ -39,15 +39,9 @@ public class UserEventCollectingUtil {
@Slf4j
@Slf4j
public
static
class
MyCallBack
<
UserRecordResult
>
implements
FutureCallback
<
UserRecordResult
>
{
public
static
class
MyCallBack
<
UserRecordResult
>
implements
FutureCallback
<
UserRecordResult
>
{
private
EventInfo
eventInfo
;
public
MyCallBack
(
EventInfo
eventInfo
)
{
this
.
eventInfo
=
eventInfo
;
}
@Override
@Override
public
void
onSuccess
(
@Nullable
UserRecordResult
userRecordResult
)
{
public
void
onSuccess
(
@Nullable
UserRecordResult
userRecordResult
)
{
log
.
info
(
"发送事件成功 o:{}
,eventInfo:{}"
,
JSON
.
toJSONString
(
userRecordResult
),
eventInfo
);
log
.
info
(
"发送事件成功 o:{}
"
,
JSON
.
toJSONString
(
userRecordResult
)
);
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment