【问题标题】:Mulesoft: taking more than 3 min to generate txt fileMulesoft:生成 txt 文件需要 3 分钟以上
【发布时间】:2020-06-25 22:31:32
【问题描述】:

我们正在读取一个小于 100 KB 的 txt 文件,并使用以下转换逻辑生成输出 txt 文件。要在生产环境中生成输出 txt 文件,需要 3 分钟以上 。有没有办法减少处理时间。

  • Mule 运行时:4.2.1
从 dw::core::Strings 导入 *
//输出应用程序/csv
输出应用程序/平面文件 schemaPath = "output-fixed-witdh.ffd" ,segmentIdent = "output-fixed-witdh"
---

有效载荷映射{
    FirstName_Out: $.ParticipantFirstName,
    LastName_Out: $.ParticipantLastName,
    IssueDate_Out: ($.ReimbursementDate splitBy ("/") map (if(sizeOf($)==1) "0" ++ $ else $) joinBy "/") as Date {format: "MM/dd/yyyy" } 作为字符串 {格式:“MMddyy”},
    Amount_Out: ($.Amount as Number*100) as String {format: "0000000000"},
    CheckType_Out: $.Method,
    CheckNumber_Out: $.PaymentNumber
}

下面是使用的架构:

form: FIXEDWIDTH
id: 'output-fixed-witdh'
name: 'output-fixed-witdh'
values: 
- { name: 'FirstName_Out', usage: M, type: String, length: 20 }
- { name: 'LastName_Out', usage: M, type: String, length: 20 }
- { name: 'IssueDate_Out', usage: M, type: String, length: 6 }
- { name: 'Amount_Out', usage: M, type: String, length: 10 }
- { name: 'CheckType_Out', usage: M, type: String, length: 2 }
- { name: 'CheckNumber_Out', usage: M, type: String, length: 8 }

【问题讨论】:

  • 嗨,Kiran,您可以添加输入片段吗?它也是一个平面文件吗?你有它的 ffd 架构吗?
  • 我同意@JorgeGarcia。上下文太少,无法理解问题。另外,你确定时间花在这个转变上吗?
  • 在它自己的问题中添加了片段详细信息。请检查一下。
  • 你确认这个具体的转换消耗了时间吗?文件包含多少条记录?
  • 只有一个文件大小为 7KB,有 70 行 13 列。

标签: dataweave mulesoft


【解决方案1】:

我会说这是 Windows 问题。在 Linux 上尝试一下。我们的应用程序可以在 Windows 上运行 6 小时 10 分钟,在 Linux 上运行。试一试。

【讨论】:

  • 我们的 prod 服务器在 Windows 上运行,没办法尝试。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-20
  • 1970-01-01
  • 2019-11-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多